5
Answers

Build a string as part of the VBA command syntax

First Last

First Last

1y
609
1

Dim buttonName As String

buttonName = columnCellLetter & "14"

I have a command:

   Me.ActiveSheet.ButtonB14.ForeColor = &HFF&

but I want to make the 'ButtonB14' part to be dynamic.

Like: Me.ActiveSheet.&buttonName&.ForeColor = &HFF&

How do I do that?

 

Answers (5)