Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default moving data dynamically based on empty cell

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" wrote in message
...
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically reference a cell based on cell content Fuad Excel Discussion (Misc queries) 2 May 13th 10 08:56 PM
Error MOVING data: Cannot empty the clipboard Tommy LE Excel Discussion (Misc queries) 1 February 12th 10 07:54 AM
Dynamically setting CELL COLORS based on TWO OTHER cell values Tom Excel Discussion (Misc queries) 3 February 22nd 09 07:34 PM
Moving data if cell is empty Ed Peters Excel Programming 4 September 12th 07 08:49 PM
How to add a Combobox dynamically based on contents of some other cell? Abhinav[_2_] Excel Programming 1 May 13th 04 11:00 AM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"