Excel 2003 - VBA is there a way to add a color gradient to cells

LNG2013

Active Member
Joined
May 23, 2011
Messages
465
In Excel 2007 and up there is an easy way to add color gradient to cells. Is there such a way in 2003? In VBA I am trying to add a color gradient effect to my header. Rows A1-M1
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I do not know how this will look in 2003, I am using 2007.

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> GradientHeading()<br><SPAN style="color:#007F00">'</SPAN><br><SPAN style="color:#007F00">' GradientHeading Macro</SPAN><br><SPAN style="color:#007F00">'</SPAN><br><br><SPAN style="color:#007F00">'</SPAN><br>    Range("A1:M1").Select<br>    <SPAN style="color:#00007F">With</SPAN> Selection.Font<br>        .Name = "Calibri"<br>        .FontStyle = "Regular"<br>        .Size = 11<br>        .Strikethrough = <SPAN style="color:#00007F">False</SPAN><br>        .Superscript = <SPAN style="color:#00007F">False</SPAN><br>        .Subscript = <SPAN style="color:#00007F">False</SPAN><br>        .OutlineFont = <SPAN style="color:#00007F">False</SPAN><br>        .Shadow = <SPAN style="color:#00007F">False</SPAN><br>        .Underline = xlUnderlineStyleNone<br>        .ThemeColor = xlThemeColorLight1<br>        .TintAndShade = 0<br>        .ThemeFont = xlThemeFontMinor<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br>    <SPAN style="color:#00007F">With</SPAN> Selection.Interior<br>        .Pattern = xlPatternLinearGradient<br>        .Gradient.Degree = 270<br>        .Gradient.ColorStops.Clear<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br>    <SPAN style="color:#00007F">With</SPAN> Selection.Interior.Gradient.ColorStops.Add(0)<br>        .ThemeColor = xlThemeColorDark1<br>        .TintAndShade = 0<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br>    <SPAN style="color:#00007F">With</SPAN> Selection.Interior.Gradient.ColorStops.Add(1)<br>        .ThemeColor = xlThemeColorAccent1<br>        .TintAndShade = 0<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br>    Range("A2").Select<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>



Kevin
 
Upvote 0

Forum statistics

Threads
1,222,040
Messages
6,163,554
Members
451,844
Latest member
ddnndd1234

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top