Thread: "Smart" Copy
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default "Smart" Copy

Hi,


Sub copyDown()
Worksheets("sheet1").Select ' <==== change as required
With Worksheets("sheet1")
lastrow = .Cells(Rows.Count, "B").End(xlUp).Row
For r = 3 To lastrow
If .Cells(r, "A") = "" Then .Cells(r, "A") = .Cells(r - 1, "A")
Next r
End With
End Sub

"Kirk P." wrote:

My set of data looks like this:

VendorNbr Amount
1000 $900
$750
$500
1120 $600
1500 $700
$800

I want the data in a more "tabular" format, so I'm hoping to copy each
vendor number down to the next populated cell, and repeat the process all the
way down (about 9,000 rows). Doing this the manually for 9,000 rows isn't a
real option. Is there some code that could automate this?