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
Access 2007 Linked to Sharepoint with Drop-downs - type mismatch
asp.net Why does'nt these required fields work. Only the Phone field works?
How to change data arrangement from Raw arrangement into column arrangement
WSUS sync problem
How do I set the marquee text of the Logon Prompt screen saver for Default User?
SQL error with web site
this exchange activesync server requires security features your phone does not support on Droid
Exchange 2007 - Test-SystemHealth (Upgrading servicepack 2)
ADO ODBC to Centura SQL DB
Simple ADODB Connection Error