0

I need to copy the data from the top row of a worksheet to all those empty rows underneath it UNTILL you get to a row that has data…then start over and copy that new data into the empty rows….and so on…

I have the code that we've written so far attached and below is an example of the data (a row with info...then blank rows that need to be filled with the above info...)

I'm not so good at this, but if anyone has any suggestions, please let me know :)
THanks
Jen

16296 INV BALLESTER CONSULTI 4541 29-Jun-07


13518 INV BEST RESEARCH 4271 23-Apr-07


13963 INV BLAUW RESEARCH 4298 30-Apr-07


14250 INV BLAUW RESEARCH 4298 15-May-07

10889 INV BRAINJUICER BV 2270 25-Jan-07

Attachments
Sub fill2()
'
' fill2 Macro
'
' Keyboard Shortcut: Ctrl+Shift+B
'
    Range("B1:F1").Select
    Selection.Copy
    Range(Selection, Selection.End(xlDown)).Select
    Range("B1:F8").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Selection.End(xlDown).Select
    
    Range("B9:F9").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Selection.Copy
    Range(Selection, Selection.End(xlDown)).Select
    Range("B9:F18").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    
    
    For x = 1 To 100
    Selection.End(xlDown).Select
    Range("B19:F19").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range(Selection, Selection.End(xlDown)).Select
    Range("B19:F25").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Selection.End(xlDown).Select
    
    
    Next x
End Sub
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by asnider
0
dim intColumn as integer
intColumn = 1
dim cellvalue as string
dim lastcellvalue as string
lastcellvalue = vbnullstring
for i = 1 to 1000000

cellvalue = cells(i,intColumn)

if cellValue = vbnullstring then
cells(i, intColumn) = lastcellvalue
else
lastcellvalue = cells(i, intColumn)
endif

next i

hope that helps!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.