Hi All,
I am having some issues with VBA selecting a specific sheet and then to run a delete row code.
The code runs fine if I manually select the sheet and execute but i'd like to add a button to my 'front page'.
Please see my code below,
The sheet I want to access to run the above code on is called Raw Sales.
Can anybody help me with expanding the above code to run from a button on a different sheet?
Any help will be hugely appreciated.
I am having some issues with VBA selecting a specific sheet and then to run a delete row code.
The code runs fine if I manually select the sheet and execute but i'd like to add a button to my 'front page'.
Please see my code below,
VBA Code:
Sub DeleteRow()
Dim r As Long
Dim LastRow As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For r = LastRow To 1 Step -1
If Cells(r, 1) = 0 Then
Rows(r).Delete
End If
Next r
End Sub
The sheet I want to access to run the above code on is called Raw Sales.
Can anybody help me with expanding the above code to run from a button on a different sheet?
Any help will be hugely appreciated.