Thank you for looking at my question,
I am trying to apply some formatting to cells in a different workbook than the user is working in.
I want to fill the header row with a colour to differentiate header from data.
The number of columns in the target worksheet depends on a value set by the user (intPeriodRange)
The code I have tried is as below but it doesn't work - how should I change it so that the colour fill works please?
With sheetobject.Range(Cells(1, 1), Cells(2, intPeriodRange + 6)).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent5
.TintAndShade = 0.599963377788629
.PatternTintAndShade = 0