View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Command Button Function

Make two buttons using the Forms toolbar. Then enter:

Dim arm_it As Boolean

Sub but1()
arm_it = True
End Sub

Sub but2()
If arm_it Then
arm_it = False
Range("E2").Value = Range("E2") + 1
End If
End Sub


in a standard module and assign the first button to but1, etc.
--
Gary's Student
gsnu200704


"bob" wrote:

I am setting up a simple interface in which I want to click Button1 and then
Button2 to increase the value in cell E2 by 1. I want the value to increase
by 1 each time I click these two button in sequence.

Can anyone provide the code to accomplish this?

thanks,
Bob