Im going to have to ask this question because it will drive me mad for the weekend. I was trying to complete something for a forum member Thread here https://www.excelforum.com/excel-pro...-on-forms.html regarding changes to large numbers of controls.
I've not much experience with class modules but got this far with code from web (attached workbook)
This creates a set number of linked controls a checkbox, a textbox and a combobox
I am trying to use the value of the checkbox to control what of the other two items is visible.
I can isolate the integer and I know that the controls exist because I can list the exact names but I just cant address them. Tried many variations. The Code would have to be in the class Module. Any help appreciated
''''''code with various attempts at addressing controls.
Private Sub EditCheck_Click()
Dim myStr As String
myStr = onlyDigits(EditCheck.Name)
With EditCheck
MsgBox EditCheck.Name & " " & "=" & " " & .Value
UserForm1.txtBox(myStr).Value = "Yeah"
'UserForm1.cboBox(myStr).Visible = Not .Value
'UserForm1.Controls.cboBox(myStr).Visible = Not .Value
'UserForm1.Controls.txtBox(myStr).Visible = .Value
End With
End Sub
Bookmarks