+ Reply to Thread
Results 1 to 4 of 4

Counter with timestamp?

  1. #1
    Registered User
    Join Date
    11-16-2009
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    4

    Counter with timestamp?

    Hello, I would like to create a macro button that when clicked adds 1 to the result of that day (and one that decreases the result by one, to handle misclicks).

    I would like it to be completely fool proof, so that all the users of the sheet have to do is click the plus sign (and the minus sign), save and close the sheet and then re-open it the following day.

    Thanks in advance!

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Counter with timestamp?

    Hello trytte,

    unfortunately, a fool-proof solution for this is not possible. You can not control how often the user will click the button to increase the value or click the button to decrase the value. With this technique, there will not be an auditable history of who clicked which button when and how often.

    The code for the button would go somewhere along the lines of

    Increase value button:
    Please Login or Register  to view this content.
    and for the decrease button

    Please Login or Register  to view this content.
    I don't advise to use that kind of code, because there is no audit trail or history.

  3. #3
    Registered User
    Join Date
    11-16-2009
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Counter with timestamp?

    Quote Originally Posted by teylyn View Post
    Hello trytte,

    unfortunately, a fool-proof solution for this is not possible. You can not control how often the user will click the button to increase the value or click the button to decrase the value.
    Hello, thanks a lot for helping out!

    I was thinking maybe there was a possibility to do some kind of vlookup to increase the cell next to the date corresponding to date(), but since I don't know any VBA I didn't know if it was possible.

    It just feels weird that a program as powerful as Excel can't handle such seemingly simple problems.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Counter with timestamp?

    Excel can handle anything the way you tell you it to handle it. This is an exercise in designing your logic.

    If you want the "click" to only work once a day, you need only store the date of the last "click" somewhere the macro can refer to. I sort of thought that's what you had in mind based on this thread's title.

    Also, looking up a date on the sheet is also possible.

    Rather than picking at this, post up your workbook with a clearly defined set of goals, think it all through. It's much easier to offer usable suggestions when we're looking at the same thing together.

    Click GO ADVANCED and use the paperclip icon to post up your workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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