I have part of a sub that captures a Button click, and then runs a processes. I want to disable the Button if the count in a cell = 0 (see red line in code) and enable it again when the sub is evoked again.
Here's what I have:
b???Enabled = True 'This is here to enable the Button when the sub is entered again after Cnt1 <> 0 and a new run starts.
Dim b1 As Button
Set b1 = ActiveSheet.Buttons("???")
If Cnt1 = 0 Then
MsgBox "There are no more Samples to Process" _
& vbCr & vbCr & "Click OK to make another selection or Quit the program", _
vbOKOnly + vbInformation, "Sample Run Over"
b???.Enabled = False
End If
The ??? is there because I can't find the Button properties name to use it (The Button text is "Load Sample & Start Processing)". I've tried turning on Design Mode through the Developer tab and then right clicked on the Button and the worksheet properties window opens in the VBA code window with no Buton properties shown. And there is no Properties selection for the Button showing when I right click on the Button.
Where are the Button properties located and will the code work if I do find the Button name and use it in place of ???.
Here's what I have:
b???Enabled = True 'This is here to enable the Button when the sub is entered again after Cnt1 <> 0 and a new run starts.
Dim b1 As Button
Set b1 = ActiveSheet.Buttons("???")
If Cnt1 = 0 Then
MsgBox "There are no more Samples to Process" _
& vbCr & vbCr & "Click OK to make another selection or Quit the program", _
vbOKOnly + vbInformation, "Sample Run Over"
b???.Enabled = False
End If
The ??? is there because I can't find the Button properties name to use it (The Button text is "Load Sample & Start Processing)". I've tried turning on Design Mode through the Developer tab and then right clicked on the Button and the worksheet properties window opens in the VBA code window with no Buton properties shown. And there is no Properties selection for the Button showing when I right click on the Button.
Where are the Button properties located and will the code work if I do find the Button name and use it in place of ???.