Microsoft
Software
Hardware
Network
Question : Public Counter in VBA
How can I declare a public variable and assign it a value of 1 and then increment that count inside procedures that will be called many times. The counter should hold the last value it has until the excel file is closed. As an example:
When the file opens icnt=1 and then inside one or more procedures that are called... icnt = icnt +1 will continue to increase icnt until the file closes.
Thanks,
Jerry
Answer : Public Counter in VBA
In any general code module's declaration section (before any procedures):
Public icnt As long
In the workbook open event handler:
icnt = 1
In your routines:
icnt = icnt + 1
Kevin
Random Solutions
IE issues with Java scripting errors, trying to print from Outlook and show websites taht have Java scripting embedded.
How do I check for the correct Excel extension when importing a file into MS Access 2003
searching a database from a form
windows 2008 terminal servver web access over internet
Convert to Primary Zone to Secondary zone
Force removed 2008 server, cant join domain. User account already exists
MS Access 2007 - Query as control source for a field
Access security query
move default mailboxes ?
MD5 Hash