Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Michael,
Should I have put Tester right before the UpdateForm (see above) to run the subroutine Tester?? It would have been clearer If I had named my sub as Sub UserForm_Initialize(). The code between Sub Tester() and End Sub, was a suggestion to replace your shown code. I am pleased that your code now works but a couple of observations: It is good programming practice explicitly to declare all variables. In this connection, see Chip Pearson's detailed observations: http://www.cpearson.com/excel/DeclaringVariables.htm and http://www.cpearson.com/excel/variables.htm Additionally, from the perspectives of readability and code maintenance, I would advocate that all variables be declared at the top of the procedure. I replaced your multiple If ... Then form with a Select Case structure as a matter of personal predelection rather than to suggest any error. Regards, Norman |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Define Variable Name using VBA | Excel Discussion (Misc queries) | |||
Userform Initialize & combo box values | Excel Discussion (Misc queries) | |||
Userform disappears when you try to initialize from a command button | Excel Programming | |||
Define variable range | Excel Programming | |||
Generic questions about variable scope the Initialize event | Excel Programming |