Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Simon,
the following piece of code can be amended easily to handle this sort of thing. This version deletes empty rows in a range. To amend for your example (and assuming your values are in column A), change the If...Then line to If Cells(r,1).value = "D" Then Cheers, Pete Sub DeleteEmptyRows() Dim LastRow As Integer Dim r As Integer Application.ScreenUpdating = False LastRow = ActiveSheet.UsedRange.Row - 1 + _ ActiveSheet.UsedRange.Rows.Count For r = LastRow To 1 Step -1 If Application.WorksheetFunction.CountA(Rows(r)) = 0 Then Rows(r).Delete End If Next r Application.ScreenUpdating = True End Sub -----Original Message----- Please help with some code for the following ..... I need to create a loop to scan down a column and if the contents of a cell are say "D" then delete this row and go onto the next entry. Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
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 Discussion (Misc queries) | |||
deleting hidden rows so i can print only the rows showing?????? | Excel Worksheet Functions |