Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to know if there's a way, within a macro, to delete rows within
a specific range if the first cell in the row is either empty or has a specific value, such as 'False'. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should do it:
Sub test() Dim TargetRange As Range Set TargetRange = Range("A10:D15") ' Change to suit desired range TargetCol = TargetRange.Column FirstRow = TargetRange.Row LastRow = TargetRange.Rows.Count + FirstRow - 1 For r = LastRow To FirstRow Step -1 If Cells(r, TargetCol).Value = "" Or _ Cells(r, TargetCol).Value = "False" Then Rows(r).Delete End If Next End Sub "Glenn" skrev i meddelelsen ... I would like to know if there's a way, within a macro, to delete rows within a specific range if the first cell in the row is either empty or has a specific value, such as 'False'. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to delete specific rows in different worksheets | Excel Programming | |||
Macro to delete rows containing specific data | New Users to Excel | |||
Macro to delete specific rows | Excel Programming | |||
To Delete the specific rows when blank is found on column A | Excel Programming | |||
Macro to delete specific rows | Excel Programming |