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
psexec - No process is on the other end of the pipe.
Plesk SSL issue in a domain.
Outlook autodiscover popup issue - SBS 2008/Exchange 2007
Script In SSIS
Making a bootable Windows XP flash drive
Building VPN with DI524 dlink router
Excel Zone Expert Discussion, Number 12
Clear Orderby on exit of form
How do I use a user-defined function in Access
InfoPath 2007: Error on file open, "InfoPath cannot create a new, blank form"