#1   Report Post  
nc
 
Posts: n/a
Default update variable

Hi

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

Thanks.
  #2   Report Post  
Bill Martin -- (Remove NOSPAM from address)
 
Posts: n/a
Default

nc wrote:

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
  #3   Report Post  
JulieD
 
Posts: n/a
Default

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

"nc" wrote in message
...
Hi

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

Thanks.



  #4   Report Post  
nc
 
Posts: n/a
Default

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

"nc" wrote in

message
...
Hi

How can I update a variable by a value of one each

time a
command button is clicked using macros?

Thanks.



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I Need VBA Assistance for global variable question Brent E Excel Discussion (Misc queries) 1 March 1st 05 08:46 PM
Manually update links Emma Excel Worksheet Functions 0 February 22nd 05 01:23 PM
Update Automatic Links Not Working in 2003 cydkil Excel Discussion (Misc queries) 2 February 15th 05 03:35 PM
Update linked cells within a workbook??? Chance224 Links and Linking in Excel 4 January 21st 05 06:33 PM
Update Individual Links mikxtr Excel Discussion (Misc queries) 3 January 21st 05 04:24 AM


All times are GMT +1. The time now is 06:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"