+ Reply to Thread
Results 1 to 6 of 6

Should be a simple question....

  1. #1
    Registered User
    Join Date
    09-28-2006
    Posts
    3

    Should be a simple question....

    okay, currently making a spreadsheet, however i just have a small problem,

    i have assigned a macro to a button, and now i need a visual basic code that will allow me to count how mny times the button has been pressed.

    so it should start at zero and count up one everytime i press the button.

    if it helps the cell i want the count to appear on is on a page called 'Final Order' and its cell C1. The Button is on a page called 'Sales page'

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by skeggy553
    okay, currently making a spreadsheet, however i just have a small problem,

    i have assigned a macro to a button, and now i need a visual basic code that will allow me to count how mny times the button has been pressed.

    so it should start at zero and count up one everytime i press the button.

    if it helps the cell i want the count to appear on is on a page called 'Final Order' and its cell C1. The Button is on a page called 'Sales page'
    Try recording a macro, Select the sheet, the cell, and +1 to it, select back to the burtton sheet, and end the macro.

    That (edit macro) should have the code you need for the button.

    ---

  3. #3
    Registered User
    Join Date
    09-28-2006
    Posts
    3
    right, see theres the problem.

    if i do that i can only think of two ways to do it.

    =sum(0+1) which leaves me with 1 everytime, since 0 replaces the 1 i had before.

    =sum(C1+1) which gves me a circular reference.

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by skeggy553
    right, see theres the problem.

    if i do that i can only think of two ways to do it.

    =sum(0+1) which leaves me with 1 everytime, since 0 replaces the 1 i had before.

    =sum(C1+1) which gves me a circular reference.
    Whichever way you go - you will finish with something that is similar to
    Please Login or Register  to view this content.
    That is all that you need.

    ----

  5. #5
    Registered User
    Join Date
    09-28-2006
    Posts
    3
    thankyou very much, it works almost perfectly!

  6. #6
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by skeggy553
    thankyou very much, it works almost perfectly!
    'Almost' is a worry, but thanks for the response.

    ps, why 'almost'?

+ 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