Help with creating 3 macro buttons

fsi

New Member
Joined
Mar 11, 2009
Messages
1
Hello all! I needed help in creating 3 buttons within Excel that perform 3 separate, but simple functions.

1. The first button I need to add a single digit every time it is pressed. So if we click the button 4 times the number 4 is shown in a separate field.

2. The second button I need to add 2 every time it is pressed. If we click the button 4 times the number 8 is shown in a separate field.

3. The third button I need to add 3 every time it is pressed. So if we click the button 4 times the number 12 is shown in a separate field.

I appreicate the help.

Rick
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
try this

Code:
Sub button_1()
Range("A1").Activate
Range("A1") = 1 + Range("A1")
End Sub

Sub button_2()
Range("b1").Activate
Range("b1") = 2 + Range("b1")
End Sub

Sub button_3()
Range("c1").Activate
Range("c1") = 3 + Range("c1")
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,142
Members
448,551
Latest member
Sienna de Souza

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top