Help needed...
I have 34 activex command buttons on the worksheet all named "Bridge_cmdbutton1" and so on until "Bridge_cmdbutton34". My code generates a random number (stored as "randomnumber") between 1 and 34, but what I can't do is make the code recognise the command button that corresponds to the random number. Currently am trying to use
or
But keep getting the error "object doesn't support this property or method"
Hope its clear what I am trying to do and thanks in advance
I have 34 activex command buttons on the worksheet all named "Bridge_cmdbutton1" and so on until "Bridge_cmdbutton34". My code generates a random number (stored as "randomnumber") between 1 and 34, but what I can't do is make the code recognise the command button that corresponds to the random number. Currently am trying to use
VBA Code:
ActiveSheet.Shapes("Bridge_cmdbutton" & randomnumber).Caption = ""
VBA Code:
ActiveSheet.Bridge_cmdbutton(randomNumber).Caption = ""
But keep getting the error "object doesn't support this property or method"
Hope its clear what I am trying to do and thanks in advance