+ Reply to Thread
Results 1 to 4 of 4

update variable

  1. #1
    nc
    Guest

    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. #2
    Bill Martin -- (Remove NOSPAM from address)
    Guest

    Re: update variable

    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. #3
    JulieD
    Guest

    Re: update variable

    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" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    >
    > How can I update a variable by a value of one each time a
    > command button is clicked using macros?
    >
    > Thanks.




  4. #4
    nc
    Guest

    Re: update variable

    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" <[email protected]> wrote in

    message
    >news:[email protected]...
    >> Hi
    >>
    >> How can I update a variable by a value of one each

    time a
    >> command button is clicked using macros?
    >>
    >> Thanks.

    >
    >
    >.
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1