I have three sets of controls whose names are the same except for their suffixes. I want to be able to pass the name suffix into a procedure as a string in order to specify which set of controls I want the procedure to focus on.
Code:
Call TestProcedure("ControlNameSuffix")
Public Sub TestProcedure(ControlNameSuffix As String)
Dim TestControl As Control
Set TestControl = "ControlNamePrefix" & ControlNameSuffix
MsgBox(TestControl.Value)
End Sub
But this just gives me a type mismatch error. How can I do this using String manipulation?