I have a pivot table on sheet3
I have a macro which refreshes the Pivot table
where A2 on sheet2 is blank, then macro to Exit , otherwise to refresh Pivot
however, when running the macro, I get a message Compile Error: Else without if
I don't know how to resolve this
It would be appreciated if someone could kindly assist me
I have a macro which refreshes the Pivot table
where A2 on sheet2 is blank, then macro to Exit , otherwise to refresh Pivot
Code:
Sub Update_Pivot()
With Sheets(2)
If .Range("A2") = "" Then
Exit Sub
End If
Else
End With
Sheets(3).Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
End Sub
however, when running the macro, I get a message Compile Error: Else without if
I don't know how to resolve this
It would be appreciated if someone could kindly assist me