Does anyone know how i can change the properties of a cmdbutton using variables?
It's hard to explain so i will give you some code...hope it will get clear:
Code:
Dim matrixindex As String
Dim buttonname As String
matrixindex = Sheets("matrix").Cells(1, 1)
buttonname = "cmd" & matrixindex
Worksheets("matrix").buttonname.Caption = "1"
It seems like vba doesn't accept the variable ("buttonname") in that last line of code.
Hope someone can help.
Cheers Arie