ksheehan1511
New Member
- Joined
- Aug 17, 2012
- Messages
- 1
I'm having trouble finding a simple (relatively so) way to add a huge chunk of code I already wrote for a previous userform to a userform that is programmatically created. The userform has a set of OptionButtons, some TextBoxes, and CheckBoxes. I previously created a userform the normal way and coded for all the event procedures in its CodeModule but now that I have a sub procedure create a userform, I want a way to use most of the code from the previous form. The only way I can find to add code to a CodeModule in the userform creation sub is to use the .CodeModule.InsertLines member and this seems very tedious as it will require me to retype everything line by line.
My question is: Is there a way around doing it this way? The reason I don't have a simple few lines calling another sub is because I have "If Option[blank] Then" commands that operate on OptionButton events and calling out to another procedure comes up with "variable undefined" errors.
Thanks!
My question is: Is there a way around doing it this way? The reason I don't have a simple few lines calling another sub is because I have "If Option[blank] Then" commands that operate on OptionButton events and calling out to another procedure comes up with "variable undefined" errors.
Thanks!
Last edited: