Tech Support Forum banner
Status
Not open for further replies.
1 - 3 of 3 Posts

· Registered
Joined
·
31 Posts
Discussion Starter · #1 ·
Can someone please change the line below in red to instead allow the macro to delete two blank formulated rows below the last filled entry in Column A?
I just can't figure it out.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub

Dim RowNum As Long
    RowNum = Target.Row
    
    If WorksheetFunction.CountA(Range("D" & RowNum & ":S" & RowNum)) > 1 Then
    Range("D" & RowNum & ":S" & RowNum).ClearContents
    Range("D" & RowNum).Select
    MsgBox "Please only make one entry per row"
    Range("D" & RowNum + 1, Range("D" & RowNum + 2)).EntireRow.Delete
End If
End If
End Sub
 
1 - 3 of 3 Posts
Status
Not open for further replies.
Top