-
Fill Down Automatically?
I need to fill in values (in same column) as in this example
so that 7533 would be filled down to the next cell containing text.
This is the same as selecting the cell containing and down, then pressing ctl+D, except I want a more automated command or macro to do this.
Seems easy....can it be done? Thanks!
A 7533
B
C
D 6588
E
-
This should do it
[vba]
Dim iLastRow As Long
Dim iNext As Long
Dim i As Long
With ActiveSheet
i = 1
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
Do Until i >= iLastRow
iNext = .Cells(i, "A").End(xlDown).Offset(-1).Row
.Cells(i, "A").AutoFill .Cells(i, "A").Resize(iNext - i + 1)
i = iNext + 1
Loop
End With
[/vba]
-
Thank you
-
Hi SunKitty,
If this is solved, you can mark it so using the Thread Tools drop-down
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules