Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count # of Times Sub Executes
Is there a way to keep track as to the number of times a
button is clicked. I have a command button on one of my sheets and would like to keep track as to the number of times a person runs the program. I would like to reset the value when Excel closes. Thanks, Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count # of Times Sub Executes
I suggest, you use a Hidden sheet, so you can do the
following things on that sheet, 1.- On excel: Tools/Macro/VisualBasic Editor/ on VisualBasicEditor: View/Project Explorer/ View/Properties Window --select the sheet you want to hide (name it "MyCounter")--- on properties, select the Visible property and set it to "2 - xlSheetVeryHidden" File/Close and return toi Microsoft Excel) 2.- On the auto_open macro, you can set the value to zero, ( say A1), on the execution of you macro you can set the value of that particular cell to the previous value plus one, with: With Thisworkbook.sheets("MyCounter").Range("A1") .Value=.Value + 1 End With You can see the value using: Thisworkbook.sheets("MyCounter").Range("A1").Value Francisco Mariscal -----Original Message----- Is there a way to keep track as to the number of times a button is clicked. I have a command button on one of my sheets and would like to keep track as to the number of times a person runs the program. I would like to reset the value when Excel closes. Thanks, Mike . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count how many times a phrase comes up? | Excel Worksheet Functions | |||
count text appear how many times & put in respec col??eg 1st times | Excel Discussion (Misc queries) | |||
Count Number of Times Q | Excel Worksheet Functions | |||
Count # of times a value is in another spreadsheet | Excel Discussion (Misc queries) | |||
Count # of times a Reference is used | Excel Discussion (Misc queries) |