Gregg Wolin
Member
I’m trying to develop a userform to handle the data entry for model and my research tells me that I should use a class module(s) to handle the formatting of the data entered into various userform text boxes. Each text box is linked via Control Source to a named range in the workbook so that any assumption changed on the worksheet would show up on the userform next time it was opened and vice versa.
The issue I’m having is the text boxes need to be formatted as currency, percentages, text run numbers and dates. It appears that using a class module would alleviate the need To create code for each individual text box however all the examples I have seen require the identification by name (In the class module) of all text boxes on the form.
It seems like I should be able to create a class module for each data “type”.
My question: is there a way to use one of the properties of each text box as (for lack of a better term) the “trigger”. In other words, if the name of a text box includes the letters PCT, the class module would identify such a box and format it as a percentage?
The issue I’m having is the text boxes need to be formatted as currency, percentages, text run numbers and dates. It appears that using a class module would alleviate the need To create code for each individual text box however all the examples I have seen require the identification by name (In the class module) of all text boxes on the form.
It seems like I should be able to create a class module for each data “type”.
My question: is there a way to use one of the properties of each text box as (for lack of a better term) the “trigger”. In other words, if the name of a text box includes the letters PCT, the class module would identify such a box and format it as a percentage?