glockgal42
New Member
- Joined
- Dec 15, 2016
- Messages
- 5
So I have two codes that I am using to delete cells from two different sheets. I first had a button on each sheet to run the macros, but instead I would like to create one button on my third sheet that will run both macros.
My first code is for Worksheet ("yard")
My second code is for Worksheet ("Yard Configuration")
Then my master code will be placed on Worksheet ("Yard Availabilities")
What's the best way to go about this?
Thank you!
My first code is for Worksheet ("yard")
Code:
Sub RemoveTractors()
Last = Cells(Rows.Count, "B").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "B").Value) = "Tractor" Then
Cells(i, "A").EntireRow.Delete
End If
Next i
End Sub
My second code is for Worksheet ("Yard Configuration")
Code:
Sub RemoveDeletedLocations()
Last = Cells(Rows.Count, "K").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "K").Value) = "Yes" Then
Cells(i, "A").EntireRow.Delete
End If
Next i
End Sub
Then my master code will be placed on Worksheet ("Yard Availabilities")
Code:
Sub FormatLists()
Call RemoveTractors
Call RemoveDeletedLocations
End Sub
What's the best way to go about this?
Thank you!