ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using a command button to add (https://www.excelbanter.com/excel-discussion-misc-queries/51637-using-command-button-add.html)

Chance

Using a command button to add
 
I would like to click on a command button - it would then add 1 to a
predetermined cell

Bob Phillips

Using a command button to add
 
Which bit do you want, the add bit

With Range("H10")
.Value = .Value + 1
End With

or add the button. Drag it off the Forms toolbar and assign a macro with the
above code

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Chance" wrote in message
...
I would like to click on a command button - it would then add 1 to a
predetermined cell




Kassie

Using a command button to add
 
Hi

You do not say at what stage this cell will be determined? Is it always the
same cell, is it the active cell, or do you want to establish which cell is
to be acted on?

--
ve_2nd_at. Randburg, Gauteng, South Africa


"Chance" wrote:

I would like to click on a command button - it would then add 1 to a
predetermined cell


Chance

Using a command button to add
 
Always the same cell

"Kassie" wrote:

Hi

You do not say at what stage this cell will be determined? Is it always the
same cell, is it the active cell, or do you want to establish which cell is
to be acted on?

--
ve_2nd_at. Randburg, Gauteng, South Africa


"Chance" wrote:

I would like to click on a command button - it would then add 1 to a
predetermined cell


Chance

Using a command button to add
 
I wanted the code.
Thank you

"Bob Phillips" wrote:

Which bit do you want, the add bit

With Range("H10")
.Value = .Value + 1
End With

or add the button. Drag it off the Forms toolbar and assign a macro with the
above code

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Chance" wrote in message
...
I would like to click on a command button - it would then add 1 to a
predetermined cell





comotoman

Using a command button to add
 

You need to have a blank cell to the right of the number you are adding
to, then select that blank cell hit the combined button assigned to
macro below.

Sub PlusOne()

ActiveCell.FormulaR1C1 = "=RC[-1]+1"

End Sub


--
comotoman
------------------------------------------------------------------------
comotoman's Profile: http://www.excelforum.com/member.php...o&userid=27292
View this thread: http://www.excelforum.com/showthread...hreadid=478309



All times are GMT +1. The time now is 02:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com