var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: change button properties with variables
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:
It seems like vba doesn't accept the variable ("buttonname") in that last line of code.
Dim matrixindex As String
Dim buttonname As String
matrixindex = Sheets("matrix").Cells(1, 1)
buttonname = "cmd" & matrixindex
Worksheets("matrix").buttonname.Caption = "1"
Hope someone can help.
Last edited by arie ribbens; 01-27-04 at 11:09.
I kinda guessing really but is this what ya meant?
thanks for your reply redma_d, but the code in the attachment is not exactly what i had in mind.
I recently figured it out and if anyone is interested this is the script that worked for me:
Worksheets("name").OLEObjects(varbuttonname).Object.Caption = "whatever you want"