Sign up, and you can make all message times appear in your timezone. Sign up
Aug 20, 2014
1:00:02pm
A thing to note here is that Application.Worksheets refers to the ActiveWorkbook
This is fine if you're only using one workbook, but can cause trouble if you're using more than one workbook (using code to copy from one to another for example) or if somehow another workbook manages to grab the focus before you hit that line in the code (not likely in simple applications, but in macros that take significant time to run it's possible).

It's a little safer to use ThisWorkbook.Worksheets.Count to guarantee that you're getting the number of worksheets in the workbook that is executing the macro.

Shouldn't make any difference for you, but something to note for future reference.
JadoX
Bio page
JadoX
Joined
Jul 12, 2011
Last login
Apr 30, 2024
Total posts
1,379 (12 FO)
Messages
Author
Time

Posting on CougarBoard

In order to post, you will need to either sign up or log in.