Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try...
Private Sub CommandButton2_Click() Dim n& With Application .ScreenUpdating = False .EnableEvents = False '//optional End With With Range("g5:g14") For n = 10 To 1 Step -1 If .Cells(n) = "" Then .Rows(n).Delete Next 'n End With With Application .EnableEvents = True .ScreenUpdating = True End With End Sub ...so your loop only acts on the target range! -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete unused rows | Excel Programming | |||
macro to delete hidden or unused rows | Excel Programming | |||
Hiding Unused Rows | Excel Programming | |||
Delete Unused (4000) Rows | Excel Programming | |||
VB Code to Delete Unused Rows | Excel Programming |