Using a command button to add

C

Chance

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

Bob Phillips

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)
 
K

Kassie

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?
 
C

Chance

Always the same cell

Kassie said:
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?
 
C

Chance

I wanted the code.
Thank you

Bob Phillips said:
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)
 
C

comotoman

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
 
Top