Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I think that the reason you have to run it repeatedly is that when the row is deleted, the macro skips a row. Try this adjustment, where the cells are searched from the bottom up. That way, as rows are deleted, it won't skip any rows: For i = finalrow to 1 Step -1 If ucase(left(Cells(i, 1),4)) = "SCOT" Then rows(i).Copy sh2.Cells(sh2.rows.count, 1).end(xlup)(2) rows(i).Delete end if next i |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Move cell info and info in range of cells on new entry | Excel Discussion (Misc queries) | |||
Hide unused rows based on column info | Excel Worksheet Functions | |||
Macro to delete blank rows and move data/info | Excel Discussion (Misc queries) | |||
Move cell info and info in neighboring cell on new entry | Excel Discussion (Misc queries) | |||
Move cell info on new entry | Excel Discussion (Misc queries) |