Module, UserForm, & MultiPage Managment

Rufus Clupea

Board Regular
Joined
Feb 11, 2019
Messages
85
I'm working on a fairly large (for me) project, using one (main) UserForm with a MultiPage. I was working under the mistaken belief that,
"A single VBA module can store any number of Sub procedures, Function procedures, and Declarations."
—Excel VBA Programming for Dummies
So most everything went into the UserForm Module. Things were going pretty well until I noticed the "fine print",
"Well, there is a limit—about 64,000 characters per module....the solution is simple: Just insert a new module."
—Ibid.
Ummm... right. :roll:

When I saw that qualifier, I copied my code into Word for a quick character count—it was something over 75,000 characters, and I knew I was only about 1/3 to 1/2 way along, so I split things into several modules, believing—as the book said—it would be "simple". That's where.... :banghead:

So I'm now engaged in probably one of many major re-writes (which is fine—I expected this :cool: ) Good time, methinks, to ask a few questions that have been collecting...

  1. Is there any way of (globally?) telling modules that they're all part of the same project, and avoiding having to re-code everything with a "UserForm1." prefix (I'm using WITH-END WITH, but there's a LOT of stuff to account for)?
  2. Is there a way to tab (key) directly from the last TabStop on one page of the MultiPage to the first TabStop on the next page without manually clicking on the MultiPage tab and the first TabStop on each subsequent page?
  3. CheckBoxes have Captions; OptionButtons have Captions. Is there an easy way to combine a SpinButton with a Label (thereby giving it a "Caption"), or must I create a whole new object? (Not sure exactly how to do that yet, but willing to learn!)
TYA

https://www.youtube.com/watch?v=BxacATCHrpo
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I've explained the concept of the code recently here: https://www.excelforum.com/excel-pr...timize-button-generator-code.html#post5085431 See if that makes it any clearer.
Can you follow that? Or have I been clear as mud? haha
Mmmmm... Good question! From what I've been able to follow (so far), it may have some application in attaching a Label to a SpinButton, but I cannot (yet) see how it would...
...figure out what kind of Control it had been sent, and then [... allow me to] send the pertinent information to Subs for processing the respective Controls? This would (theoretically) allow me to use one Control naming/numbering scheme rather than different naming/numbering for each flavor of Control.

I think I may be on to something with User-Defined Date Types (they used to be called Records back in my C-64 days). Not positive, but reading & experimenting will likely keep me occupied for a bit... :)

Also, after looking ahead to see if/how I could apply your example... I realized the next group (couple-three hundred) SpinButton/Label combinations need to be <s>somewhat</s> quite different from the first 72, so I need to give this a bit more thought... :lookaway:

I've copied your code & explanation into a (more readily accessible) text file that I can refer to & study as I'm learning more, so thank you again for that. I'm sure I'll be able to glean & adapt at some point.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top