moving data dynamically based on empty cell

I have a data sheet that looks like this...

col a   col b
abc     10
          20
          45
efg      5
          18
          10

I need it to look like this...
col a   col b
abc     10
abc     20
abc     45
efg      5
efg      18
efg      10

since there is no consistency to the number of rows in col b with data, i 
have to come up with a formula that is dynamic

The file has 20,000 rows so doing it manually is not the way to go.

Thanks
0
Utf
2/10/2010 6:33:01 PM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
918 Views

Similar Articles

[PageSpeed] 22

Give this macro a try...

Sub FillInTheBlanks()
  Dim Area As Range, LastRow As Long
  Const ColLetter As String = "A"
  On Error Resume Next
  LastRow = Cells.Find(What:="*", SearchOrder:=xlRows, _
            SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row
  For Each Area In Columns(ColLetter)(1).Resize(LastRow). _
                   SpecialCells(xlCellTypeBlanks).Areas
    Area.Value = Area(1).Offset(-1).Value
  Next
End Sub

-- 
Rick (MVP - Excel)


"stickandrock" <stickandrock@discussions.microsoft.com> wrote in message 
news:2E2CEE3E-C0BB-4BD9-B0E1-F4C06539B13D@microsoft.com...
>I have a data sheet that looks like this...
>
> col a   col b
> abc     10
>          20
>          45
> efg      5
>          18
>          10
>
> I need it to look like this...
> col a   col b
> abc     10
> abc     20
> abc     45
> efg      5
> efg      18
> efg      10
>
> since there is no consistency to the number of rows in col b with data, i
> have to come up with a formula that is dynamic
>
> The file has 20,000 rows so doing it manually is not the way to go.
>
> Thanks 

0
Rick
2/10/2010 6:39:36 PM
Reply:

Similar Artilces:

Formatting Problem-Highlighting a cell when date has expired past current date
Hi, I'm currently trying to set up a sheet that highlights when current certificate has expired. When a user enters a date in a cel and as time passes, that date expires, I'd like to highlight the cel and ideally make it automatically say the word expired instead of th date. If anyone can help it would be greatly appreciated. Thank -- Message posted from http://www.ExcelForum.com Hi for highlighting the cell you can use conditional formating: - select your cell - goto 'Format - Conditional format' - enter the formula (if A1 is your cell) =A1>TODAY() - choose your format...

Problem with Disabling a Cmd Button Based on Another field in the
I am using Access 2000. I have a command button that should be enabled if the OwnerStatus = "Current Owner" and disabled for any other value. This is my code: Function SetOneInvoiceCommand() As Boolean Dim blnEnable As Boolean If Me![OwnerStatus] = "Current Owner" Then OneInvoiceCommand.Enabled = True Else OneInvoiceCommand.Enabled = False End If End Function When I 1st enter the form, the OneInvoiceCommand button is ENABLED no matter what the value is in the OwnerStatus field. However once I click the Owner Status field once, the ...

space between y axis and data points..
I have a line graph with markers, and am plotting 7 pre-post (x axis) lines on a y axis of 1 to 100. By default, the "pre" points were plotted right on the y axis and the post points were all the way at the right end of the plot area. I checked "Value (y) axis crosses between categories", and this moves the pre (and post) towards the middle of the plot area, so that the points are now plotted to the right of the y axis. My question is, can I adjust the space between the y axis and where the "pre" data points are plotted? As they are now, there is too much of a g...

Moving license to a new computer
I bought a powerbook and am giving the kids my old imac. I'd like to move Office to the powerbook and remove it from the imac. Am I going to run into any technical difficulties doing this? In article <do3en0hjuiv1jrgsan1tlf23demblohh9p@4ax.com>, Andrew D <andrew.davilman@mindspring.com> wrote: > I bought a powerbook and am giving the kids my old imac. I'd like to > move Office to the powerbook and remove it from the imac. Am I going > to run into any technical difficulties doing this? Shouldn't. Run the Remove Office application on the iMac, and inst...

not able to move FLAG STATUS column in Outlook 2003
I tried to move FLAG STATUS column from the very right side to the left side when I am in my Inbox. IT WON'T LET ME!! Anyone was able to do that? No. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Kenny Shu asked: | I tried to move FLAG STATUS column from the very right | side to the left side when I am in my Inbox. IT WON'T LET | ME!! | | Anyone was abl...

Bring filtered data from another file
I have a Birthdays file I have a Calendar file After each date in this calendar file I have 4 empty lines (assumption: max 4 birthdays on the same day) 15.01.2010 ......... ......... ......... ......... 16.01.2010 ......... ......... ......... ......... How can I bring the names for each date from the Birthdays file. Thanks and regards, CousinExcel ...

reference a cell AND its format in a new cell
Seems like there would be a simple way to reference a cell and any formatting it has. For example, A1=5 and the 5 is underlined and in red. The entry in A2 is =A1 and I want A2 to show not only the 5 but I also want it to preserve and show the same formatting that was applied to A1. Thanks in advance for the help. Formulas don't do this kind of thing. You could copy|Paste???? TiChNi wrote: > > Seems like there would be a simple way to reference a cell and any > formatting it has. For example, A1=5 and the 5 is underlined and in > red. The entry in A2 is =A1 and I want ...

How do I print grid lines in a spreadsheet if no data is entered .
I am trying to create a form and need to print the grid lines as a part of the form. Others will use this form and make pencil entries in the cells which will be entered into the spreadsheet at a later date. How do I do this? I am using Office 2003. Many thanks---Justaone Just File>Page Setup>Sheet. Check "gridlines" and make sure "draft quality" is not checked. May be easier and more readable to have borders around just those cells that will be pencil-entered. If you go that route, uncheck "gridlines" in Page Setup. Gord Dibben Excel MVP On Sun, 2...

Safe to Move?
Hello, I remember seeing an article about moving $NtServicePackUninstall$ files to free up space. I think it was for Windows 2000 Server. Is it possible to do this for Windows 2003 server? -- Thank you for your help! JYC Hello Mr. JYC, Yes, you can do it and if are sure that there is no need to uninstall it you can delete it. Best regards Meinolf Weber Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights. ** Please do NOT email, only reply to Newsgroups ** HELP us help YOU!!! http://www.blakjak.demon.co.uk/mul_crss.ht...

Moving Exchange 2000
Hi, I have a exchange 2000 server running on windows 2000 which I need to move onto a new server/hardware but cannot find techincal documents telling me how to do this. The only documents I can find are on disaster recovery which doesnt seem to cover moving exchange across onto new hardware. Does anybody have some a document ??? Also I would like to run exchange 2000 on server 2003, I'm guessing that this won't be a problem to move it onto new hardware running server 2003 ?? Kind Regards Paul... Use the move-server method detailed here: http://tinyurl.com/ys7e9 -- Neil H...

Creating a goto/anchor in excel based on a cell value
Hello, I am creating a financial worksheet for a client in which the user can choose options from a drop down menu. What I want to happen is, based on the option the user chooses, the model sends them to a certain cell on the same sheet. Ex: If user chooses 1 from the drop down, it sends them to cell A4. If the user chooses 2 from the drop down, it sends them to cell A5. Also, I would like to know how to trigger a macro based on a cell value Here is the code I thought might work =if(A1=1, Run_OLM(),"") Any advice on these topics is much appreciated. Thanks in advance. Tushar...

Copy or Move row on condition to different and/or multiple sheets
Good afternoon. I'm new to the world of programming in excel but have programmed elsewhere previously. What i am trying to do is to have a todo list setup, ive searched long and hard and can't find anything that quite fits my bill that i can replicate and alter to work so am asking for some assistance. I have a workbook with six sheets, All Jobs, Evaluation, Authority, In Progress, Completed and a helper sheet. In all jobs i have 9 columns A-I (atm A being spare) that have information that i need to show. In column 'I' i have a dropdown box using the helper sheet for p...

Live Mail,I can't move message "unknown Error" appears
-- There are several messages that I want to place in folders, but when I try to move them, I receive the message "Unable to move, Unknown Error". This is more than annoying, as these are important messages from various organizations I belong to. I like to archive these within the confines of Live Mail, and I don't want to hve to go in and out to various folders. Any help will be appreciated. Windows Live Mail Newsgroup. In your newsreader: news://msnews.microsoft.com/microsoft.public.windows.live.mail.desktop On the Web: http://www.microsoft.com/communiti...

Conv Access 97->2000-Gets a method or data member not found error
For the following code which compiles and runs successfully in MS Access 97, when converting to MS Access 2000 the following compile error occurs "Method or data member not found." for the line below. tempID = rs.[UserID] UserID is a field in the tblSecurity table. It seems that the tblSecurity table is not opening in MS Access 2000 since this error will occur using any field, not just UserID. This error does not occur in MS Access 97. PLEASE HELP. The routine is displayed below. Sincerely thanks, Phil ------------------ CODE - Shown Below ------------------ Private Sub...

Read Receipts won't move to 'delete bin' after processing
Very simply, my read receipts won't move to 'delete bin' after they are processed. This doesn't seem like a complex process. The tracking option allows me to either turn this rule on or off. What else am I supposed to do? I have receipts all over the place and I end up deleteting them manually. Hy, You have to delete it by yourself. It wont work with a rule. >-----Original Message----- >Very simply, my read receipts won't move to 'delete bin' after they are processed. This doesn't seem like a complex process. The tracking option allows me to either ...

mail moved from netscape to outlook?
Hello! I would like to know is it possible to move the mails from netscape mail to outlook? And what is the way? Thanks! >-----Original Message----- >Hello! I would like to know is it possible to move the >mails from netscape mail to outlook? And what is the way? >Thanks! >. > <anonymous@discussions.microsoft.com> wrote in message news:d08901c3efb2$759a75e0$a101280a@phx.gbl... > > >-----Original Message----- > >Hello! I would like to know is it possible to move the > >mails from netscape mail to outlook? And what is the way? > >Thanks! ...

made sheet , cant get back to data!
I made a graphic "sheet" and now the graph seems to Own the world; I can see the 'source data' but I cannot get back to the original data so I can sort it before making the chart. Ack! Rick Merrill wrote: > I made a graphic "sheet" and now the graph seems > to Own the world; I can see the 'source data' but > I cannot get back to the original data so I can > sort it before making the chart. Ah ha! I turned it into a piece of the original sheet and now I can sort the data! ...

Moving Pages between two publications
How can I move several entire pages from one document to another? Not simply the content of the page, but the format as well as positioning? Select all the elements on one of the pages and Group them together (a little icon will appear at the bottom of the bounding box - click it to lock the group) before you Copy and paste to the other publication. "FrankDe" <FrankDe@discussions.microsoft.com> wrote in message news:B2DF180E-4973-43D3-8278-7EDDF897EA60@microsoft.com... | How can I move several entire pages from one document to another? Not simply | the content of the ...

Counting unique cells (with text) in a filtered list
Hi Is there a simple way to count unique text values in the 'header" of a column where the adjoining column has had the filter switched on? Example A Home B Car B Home C Home C Home D Car If filtered on Home in the second column, should show 3 (ie A,B and C). Thanks in advance Try this array formula** : =SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(A2:A7,ROW(A2:A7)-ROW(A2),0,1)),MATCH(A2:A7,A2:A7,0)),ROW(A2:A7)-ROW(A2)+1)>0,1)) ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key ...

Move mailbox rights in Exchange 5.5 #2
What is the most restrictive set of rights that would allow an administrator to move mailboxes between 2 servers in the same site? Providing the administrator an admin role on the Servers container, on each server, or on the Private/Public Information Store gives him undesired privileges (like changing default storage limits). Thanks in advance for any assistance. ...

Importing Data Files
Hey all, I have recently had to undergo a clean install of Windows XP onto a new Computer, and am having trouble importing all my MS Outlook XP data into XP (from 98SE). Thanks, -- Daniel Becroft ; ================================= "Real computer scientists don't comment their code. The identifiers are so long they can't afford the disk space." "Blue sparks and white smoke, the two most expensive components of any electrical system, and once used up will cost a fortune to replace." What is the exact issue? You can connect to the file by File -> Open -> ...

Does Excel data merge with .mrg documents?
I run a database for my company, and always have a difficult (read - lots of hand typing) time getting my .mrg data doc to merge with Excel. Most times Exel will have all the data in one cell (making it impossible to sort), or not come through at all. Is it just me, or does Excel not work well with this kind of document. ...

Move users from none Business Unit to other
hi, is it possible to move a user from one business unit to other ? Yes it is. However when you move them they will lose their security role so you will need to add a security role to their user record "M. Ceccacci" <anonymous@discussions.microsoft.com> wrote in message news:D9C93DCE-6400-4C1F-BE36-C86832BA9DCD@microsoft.com... > hi, is it possible to move a user from one business unit to other ? should have said!! to do this go to settings, business units, users then open up the users record then click actions - change business unit. once done make sure you reassign...

data in queries
Hi! From a dataset I retrieve customer names and the products they have purchased: client name product name client 1 product a client 1 product b client 1 product c client 2 product b client 2 product d client 3 product a client 3 product e No problem. But how can I avoid the repetitions in the ClientName column: client name product name client 1 product a product b product c client 2 product b product d client 3 product a product e In Query View. I think in a Report this is done through Group By? Thanks ...

moving companies moving loans moving budget
moving companies moving loans moving budget http://www.movingcompanies.co.il ...