VBA Beginner Buttons & Counting Clicks

Anonymous
2020-02-27T03:52:23+00:00

How do you create a button that counts the clicks of other buttons in VBA? I have 6 buttons on my spreadsheet. I need one of those buttons to count the number of clicks of each of the other buttons plus itself. I do not understand the code needed to complete this task.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2020-02-27T04:58:48+00:00

    To:  LG213

    re:  keeping track

    You use a public variable at the top of the module.

    Then every time one of the Buttons is clicked you add a value of 1 to the public variable...

    '---

    The free Excel workbook "Professional_Compare" is now available at MediaFire. (compares every cell Or each row against all rows (two worksheets) - choice of compare type)

    Includes an optional Clean Data utility. Download (no ads) from:  http://www.mediafire.com/folder/lto3hbhyq0hcf/Documents

    0 comments No comments