Consulting

Results 1 to 4 of 4

Thread: Solved: Count click events then add value to label

  1. #1

    Solved: Count click events then add value to label

    Is there a way to count the number of times a person clicks on a button in a user form, and then populate a label with that value until the user form is closed.
    What I am trying to do is every time the workbook is opened the information is added to the next blank row. The information added could be x amount of times. The label would count the x amount of times by keeping track of the click event.
    See The Attachment.
    1. Button = cmdAdd adds the data to the first blank cell.
    2. Label = lblrecno would count the cmdAdd button click events.
    I hope this makes sense. THANKS in advance.

  2. #2
    VBAX Mentor tpoynton's Avatar
    Joined
    Feb 2005
    Location
    Clinton, MA
    Posts
    399
    Location
    what's this for? sounds like homework. You can ask questions about homework, just be transparent about it!

  3. #3
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    Hi Ben,

    Attached is the way I would do it. If it is homework, make sure you understand what I've done and can explain it before handing it in! Ask me for explanations if need be. It's about learning, either way.
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

  4. #4
    THANK YOU ! THANK YOU! The code is well explained. Not for homework just an idea to use this label and the current day as unique identifier for each item added to my sheet. THANK YOU AGAIN.

Posting Permissions

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