Joe4
MrExcel MVP, Junior Admin
- Joined
- Aug 1, 2002
- Messages
- 73,974
- Office Version
- 365
- Platform
- Windows
I am writing a User Form to updates values on a spreadsheet. As such, there are multiple macros associated with the User Form (initialize, verify, update, etc.).
Basically, I am updating 30 funds on the user form. In multiple macros, I am looping through each fund. I have dimensioned a variable named NumFunds, which I set equal to 30. So all my loops begin...
For i = 1 to NumFunds
Is there a way I can globally define NumFunds? I would like to set it to 30 just once, rather than within each and every macro. That way, if the number of funds ever increases, I will only need to change one variable.
Basically, I am updating 30 funds on the user form. In multiple macros, I am looping through each fund. I have dimensioned a variable named NumFunds, which I set equal to 30. So all my loops begin...
For i = 1 to NumFunds
Is there a way I can globally define NumFunds? I would like to set it to 30 just once, rather than within each and every macro. That way, if the number of funds ever increases, I will only need to change one variable.