I have a userform that will have multiple text boxes for users to edit data pulled from one of the Sheets.
In that userform I have corresponding labels for each text box to show the number of characters each has.
I want each respective label to update their caption to be displayed as the user is editing each text box.
The method I have come across to do this is by using a Class module.
However, I am having an issue with the label caption not displaying on the userform.
The below code is an example of the code I'm using on just a single text box and single corresponding label named ItemNumber and ItemNumberLength respectively:
Private WithEvents MyTextBox As MSForms.TextBox
Public Property Set Control(tb As MSForms.TextBox)
Set MyTextBox = tb
Private Sub MyTextBox_Change()
Dim tbCollection As Collection
Private Sub UserForm_Initialize()
Dim ctrl As MSForms.Control
Dim obj As clsTextBox
Set tbCollection = New Collection
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.TextBox Then
Set obj = New clsTextBox
Set obj.Control = ctrl
Set obj = Nothing
Public Sub PersistentUpdate_ItemNumber()
ItemNumberLength.Caption = Len(ItemNumber.Text)
Thanks in advance!