Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd use:
'not sure what firstrow is here -- not sure if you want to 'use FirstRow or FirstRow - 1 'for example: if FirstRow is 1, then FirstRow - 1 won't work 'start with the row above For Lrow = LastRow - 1 To FirstRow - 1 Step -1 'but look at the row below If .Cells(Lrow + 1 , "A").Value = "Employee Name" Then .Rows(Lrow).resize(2).Delete end if Next Lrow ps. I hate that single line if/then/else (especially with the line continuation character). My eyes sometimes miss it and I hate when that happes! mooresk257 wrote: Hi Folks, I want to delete two rows - one row has the words "Employee Name" in the first column, and the row before it. This for-next loop removes the row with "Employee Name": For Lrow = LastRow To FirstRow Step -1 If .Cells(Lrow, "A").Value = "Employee Name" Then _ .Rows(Lrow).Delete Next Lrow Any suggestions how to delete the row with "Employee Name" and the one before it? Thanks! Scott -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
deleting blank rows for up to 60000 rows of data | Excel Programming | |||
Macro for deleting rows and serialising the remaing rows | Links and Linking in Excel | |||
Macro for deleting rows and serialising the remaing rows | Setting up and Configuration of Excel | |||
Macro for deleting rows and serialising the remaing rows | Excel Worksheet Functions | |||
Help!!! I have problem deleting 2500 rows of filtered rows | Excel Programming |