Is it possible to declare a string variable which is the contents of a referenced cell and then use that string in the VB code itself?
For instance if a String variable is declared like this:
Dim stringTest As String = 'the contents of sheet01, cell A1'
Not sure how the code would go on the r/h side of the equals?
So if cell A1 in sheet01 contained the string 'wk52' would the first line of code below be understood as Sheets("wk52").Select ?
Sheets(stringTest).Select
ActiveSheet.Unprotect
Range("AA52:AD53").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0
Therefore you have the option of making changes to sheets using a macro and selecting the sheet to be changed by just typing it into a cell.
For instance if a String variable is declared like this:
Dim stringTest As String = 'the contents of sheet01, cell A1'
Not sure how the code would go on the r/h side of the equals?
So if cell A1 in sheet01 contained the string 'wk52' would the first line of code below be understood as Sheets("wk52").Select ?
Sheets(stringTest).Select
ActiveSheet.Unprotect
Range("AA52:AD53").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0
Therefore you have the option of making changes to sheets using a macro and selecting the sheet to be changed by just typing it into a cell.