Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey,
I was wondering if there is a more efficient way to write this macro. It searches through a selected range and deletes any row that is valued as True. I made it to remove duplicates based on various criteria that I change from project to project. Thanks for any insight! Sub Delete_True_Rows_In_Selection() Dim TotalRows As Integer Dim FirstRow As Integer Dim Col As Integer Dim Row As Integer TotalRows = Selection.Rows.Count FirstRow = Selection.Row() Col = Selection.Column() Application.ScreenUpdating = False On Error Resume Next For Row = FirstRow To TotalRows If Cells(Row, Col).Value = True Then Rows(Row).Delete Row = Row - 1 End If Next Row Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA for deleting duplicate rows | Excel Programming | |||
deleting mulitple rows when the checkbox value = true. | Excel Discussion (Misc queries) | |||
Need Help with Deleting Duplicate rows | Excel Programming | |||
Deleting Duplicate Rows | Excel Programming | |||
Deleting duplicate rows.....there's more | Excel Programming |