Range("BD8:BD9") = ""
Range("BA8") = "CANCEL ALL"
Range("BA9") = "GREEN ALL"
Sub ClearStatusCol()
'
' ClearStatusCol Macro
'
Range("BD8:BD34").Select
Selection.ClearContents
Range("AS2").Select
End Sub
Sub ClearStatusCol()
'
' ClearStatusCol Macro
'
Range("BD8:BD34").ClearContents
End Sub
Sub CancelAllGreenAll()
'
' CanceAllGreenAll Macro
'
Range("BD8:BD33") = ""
Range("BA8") = "CANCEL ALL"
Range("BA9") = "GREEN ALL"
etc...
Sub CancelAllGreenAll()
'
' CanceAllGreenAll Macro
'
Range("BA8") = "CANCEL ALL"
Range("BA9") = "GREEN ALL"
' Clear the status cell after putting commands into the command cells, not before.
Range("BD8:BD33").ClearContents
etc...
Function RangeIsEmpty(ByVal SourceRange As Range) As Boolean
RangeIsEmpty = (WorksheetFunction.CountBlank(SourceRange) = SourceRange.Count)
End Function
Option Explicit
Option Compare Text
Sub Rummble2()
Dim Lr As Integer, x As Integer
'Get the last used row in column A (if the runner names are in column A, if not, change to suit)
Lr = Sheets("Cymatic").Range("A65536").End(xlUp).Row
If Lr < 8 Then Exit Sub 'if no runners exit the subroutine
If Lr > 34 Then Lr = 34 ' (don't want to clear anything below this row)
'start from row of first horse
For x = 8 To Lr
If Sheets("Cymatic").Cells(x, 56) = "PLACED" Then '(BD is the 56th column)
Sheets("Cymatic").Cells(x, 56).ClearContents
End If
Next
'NOTE: To Excel, there is a difference between "PLACED" and "placed". If you have "placed" in the cell, it will not be
'cleared. Include the "Option Compare Text" (above the name of the sub), and Excel will treat it as the same.
End Sub
Return to Excel - Sample Spreadsheets
Users browsing this forum: No registered users and 0 guests