Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Command Button Function

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assign Function to a Command Button MUEEN SEHDI Excel Discussion (Misc queries) 1 October 29th 09 11:25 AM
command button to do F9 function Jay Excel Programming 3 October 3rd 06 11:46 PM
Command button to run calculation function Fleone Excel Programming 1 April 28th 06 10:14 PM
using command button instead of edit function john tempest[_2_] Excel Programming 7 December 21st 05 06:41 PM
Command Button Function - Macro NickH[_2_] Excel Programming 3 January 22nd 04 11:02 AM


All times are GMT +1. The time now is 06:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"