Hi fatinmunie and welcome to ExcelForum,
You were very close. Your 'startTimer' needs to be a global variable. In your code, each Sub is isolated from each other, so UserForm_Activate() never was able to get the new value of startTimer from the other routines.
To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. dim i as Integer). http://www.cpearson.com/excel/DeclaringVariables.aspx
See the attached sample workbook (20 second timeout because I am impatient) and the code that follows below.
In the UserForm1 module:
Ordinary Code Module:
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
(This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
I answered your question, because this was your first post.
Lewis
Bookmarks