View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Copy down to next Cell

try this macro:

Sub samc()
n = Cells(Rows.Count, "B").End(xlUp).Row
For i = 3 To n
If (IsEmpty(Cells(i, "B"))) Then
Cells(i, "B").FillDown
End If
Next
End Sub

--
Gary''s Student - gsnu200737


" wrote:

I have a spreadsheet that is 30000 lines long. I have to copy down a
different value to about 20 spaces below.
For example I have the first value in b2, the the next 20 rows under
this are blank then the new value starts in b22 then the next 20 rows
under this are blank the then new value starts in B42.

How to I fill in the blanks all the way to the end of the 30000 lines?

Thanks
Sam