Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Need a macro to delete anything with numeric value

0

I have the below Macro and it works except I need to add to the line that is deleting info based on a value.  I need the macro to delete the row if it contains a numberic or date value.  below is my macro

Sub deleteresident()
         Dim lngLoopCtr As Long
    
    Application.ScreenUpdating = False
    For lngLoopCtr = 800 To 15 Step -1
        If UCase(Cells(lngLoopCtr, "b")) = "EMPTY" Or UCase(Cells(lngLoopCtr, "b")) = "RESIDENT" Or UCase(Cells(lngLoopCtr, "b")) = "" Then
            Rows(lngLoopCtr).EntireRow.Delete
        End If
    Next lngLoopCtr
    Application.ScreenUpdating = True
    
End Sub

Answer
Discuss



Answer the Question

You must create an account to use the forum. Create an Account or Login