update variable

N

nc

Hi

How can I update a variable by a value of one each time a
command button is clicked using macros?

Thanks.
 
G

Guest

nc said:
Hi

How can I update a variable by a value of one each time a
command button is clicked using macros?

Thanks.
---------------------------------

Even easier, rather than a "button" use a "spinner". It's available to
you on the same tool bar you'd use to create a "button". It provides a
both up and down buttons to increment or decrement a cell. In the
properties for the spinner you can define the cell to link it to. No
macro required.

Good luck...

Bill
 
J

JulieD

Hi

assuming you mean a cell value by 1 something along the lines of

Sub increasevalue()
If IsNumeric(Range("A1")) Or IsNull(Range("A1")) Then _
Range("A1").Value = Range("A1").Value + 1
End Sub

if this isn't what you've after could you please explain what you mean by a
"variable"

Cheers
JulieD
 
N

nc

Thanks JulieD.

-----Original Message-----
Hi

assuming you mean a cell value by 1 something along the lines of

Sub increasevalue()
If IsNumeric(Range("A1")) Or IsNull(Range("A1")) Then _
Range("A1").Value = Range("A1").Value + 1
End Sub

if this isn't what you've after could you please explain what you mean by a
"variable"

Cheers
JulieD




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top