VarButton = "Button"
For Each tObj In UserForm1.Controls
If Left(tObj.Name, 6) = "Button" Then
tObj.Caption = VarButton
End If
Next
Not sure exactly what you are wanting to do, but you could access all The objects on your userform whose names start with Button like this:
Code:VarButton = "Button" For Each tObj In UserForm1.Controls If Left(tObj.Name, 6) = "Button" Then tObj.Caption = VarButton End If Next
Not sure exactly what you are wanting to do, but you could access all The objects on your userform whose names start with Button like this:
Code:VarButton = "Button" For Each tObj In UserForm1.Controls If Left(tObj.Name, 6) = "Button" Then tObj.Caption = VarButton End If Next