I am trying to run this macro to shift data up on multiple sheets after the rows have been deleted. I keep getting a compile error "End if Without Block If"
Here is my vba code:
Sub shiftmeup()
Dim ws As Worksheet
Dim wb As Workbook
Set wb = ThisWorkbook
Set ws = wb.Sheets("contactunder") '/// The underhood of my contacts
Set ws1 = wb.Sheets("Deposits")
Set ws2 = wb.Sheets("Lending")
Set ws3 = wb.Sheets("Client Notes")
With ws.Range("D11:BJ392")
For i = .Rows.Count To 1 Step -1
If IsEmpty(.Cells(i, 1)) Then .Rows(i).Delete Shift:=xlUp
Next
With ws1.Range("E11:l392")
For i = .Rows.Count To 1 Step -1
If IsEmpty(.Cells(i, 1)) Then .Rows(i).Delete Shift:=xlUp
Next
With ws2.Range("E11:Y392")
For i = .Rows.Count To 1 Step -1
If IsEmpty(.Cells(i, 1)) Then .Rows(i).Delete Shift:=xlUp
Next
With ws3.Range("E11:E392")
For i = .Rows.Count To 1 Step -1
If IsEmpty(.Cells(i, 1)) Then .Rows(i).Delete Shift:=xlUp
End If
Next
End With
End Sub
Bookmarks