![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: West Sussex
Posts: 2
|
I have several rows of text which look as follows:
LONDON eng eng GLASGOW sco sco I need a macro to autofill from the top row and then skip the missing cell to autofill the next block. This list is about 5000 rows so the macro will have to always find the next block and fill it until there is no more data. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
Hi Graham
Would this do the trick?? Assuming the Column in question is Column A and data starts in A1 and the first data item is something we would want to copy down... Sub test() Lastrow = Range("A65536").End(xlUp).Row Range("A1").Select Do While ActiveCell.Row < Lastrow + 1 If ActiveCell.Value <> "" And ActiveCell.Offset(1, 0).Value <> "" Then Selection.Copy ActiveCell.Offset(1, 0).Select ActiveSheet.Paste Else ActiveCell.Offset(1, 0).Select End If Loop End Sub |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Location: West Sussex
Posts: 2
|
Thanks, that is absolutley perfect!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|