PhilipJPSmith
New Member
Hi. I have a quarterly report which is used as a standard template for many clients. Each client has its own branding style, which will include underlining.
I have a macro that amends built in styles from data held in a table.
The following code works, except for the underlining.
The named range "Underline" can include one of the following options selected from a data validated list:
xlUnderlineStyleDouble
xlUnderlineStyleDoubleAccounting
xlUnderlineStyleNone
xlUnderlineStyleSingle
xlUnderlineStyleSingleAccounting
StyleName is one of the standard Excel styles.
I would be grateful if anyone could spot the error in the syntax. I've googled but have been able to find a solution.
I have a macro that amends built in styles from data held in a table.
The following code works, except for the underlining.
Code:
With ActiveWorkbook.Styles(StyleName).Font
.Name = Range("Font_Name").Value
.Size = Range("Size").Value
.Bold = Range("Bold").Value
.Italic = Range("Italic").Value
.Underline = Range("Underline").Value
.Strikethrough = Range("Strikethrough").Value
.Color = RGB(Range("Red").Value, Range("Green").Value, Range("Blue").Value)
.TintAndShade = Range("Tint_And_Shade").Value
End With
The named range "Underline" can include one of the following options selected from a data validated list:
xlUnderlineStyleDouble
xlUnderlineStyleDoubleAccounting
xlUnderlineStyleNone
xlUnderlineStyleSingle
xlUnderlineStyleSingleAccounting
StyleName is one of the standard Excel styles.
I would be grateful if anyone could spot the error in the syntax. I've googled but have been able to find a solution.