KlausW
Active Member
- Joined
- Sep 9, 2020
- Messages
- 381
- Office Version
- 2016
- Platform
- Windows
Hello, is it possible to make a button that on the first press puts 1 in cell E1 and if I press it once more puts a 0 in cell E1.
I have tried with this VBA code but it doesn't do what I want.
Any help will be appreciated.
Best Regards
Klaus W
I have tried with this VBA code but it doesn't do what I want.
Any help will be appreciated.
Best Regards
Klaus W
VBA Code:
Private Sub CommandButton1_Click()
Range("D3").Value = Range("D3") + 1
Range("D3").Value = Range("D3") - 1
End Sub