Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello-
I have tried multiple examples to get rows deleted where the value in column B is less than 50. In my code, before the attached code runs, I have formatted column B as a number, no decimals. Can anyone tell me why the code is erroring our? Sub DeleteCallTags() 'will delete rows where column B <50 Dim cell As Range Dim delRange As Range For Each cell In Range("B1:B" & Range("B" & Rows.Count).End(xlUp).Row) If cell.Value < 50 Then ******This is the line that gets highlighted when I hit "debug" If delRange Is Nothing Then Set delRange = cell Else Set delRange = Union(delRange, cell) End If End If Next cell If Not delRange Is Nothing Then delRange.EntireRow.Delete End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Rows Based on Words | Excel Discussion (Misc queries) | |||
Macro to delete rows based on a condition | Excel Worksheet Functions | |||
How can I delete rows programmatically based on certain criteria? | Excel Worksheet Functions | |||
Delete rows based on criteria | Excel Discussion (Misc queries) | |||
Delete rows based on certain criteria | Excel Discussion (Misc queries) |