Increase cell value by set amount with a "button" key

mactoolsix

Board Regular
Joined
Nov 30, 2010
Messages
105
I have a cell that I would like to increase by "x" amount each time I click on one key. I see I can use a "button" key from the developer design tools, but I think I would need to enter a macro to use that method.

Is there a way to do this with out a macro?

Using Excel 2010 with windows 10.

Thanks,
Mike
 
Last edited:

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
The easiest way to do this is:

1. Insert an Active X Command Button from the Developer, Insert menu

2. Right-click on button and select View Code

3. Inert this code :

Code:
Private Sub CommandButton1_Click()
    Range("B1") = Range("B1") + Range("A1")
End Sub

4. Enter a value in cell A1

5. Click on Design Mode to take you out of design mode (toggle)

6. See the cell B1 increase by the value of A1 each time you click the button
 
Upvote 0
Yes to increase a cells value by x amount assuming x would always be different you would need a macro.
Now some macros can run by just entering a value into a cell. Does not require a button.

For example put the value to increase by in Range("A1") and the cell value of Range("B1") will increase by that amount automatically.

Use this script to do that:

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 1 And Target.Value <> "" And IsNumeric(Target.Value) = True Then
Target.Offset(0, 1).Value = Target.Value + Target.Offset(0, 1).Value
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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