changing the color pattern of a cell in vba

jc352

Board Regular
Joined
Aug 13, 2008
Messages
134
Office Version
  1. 365
Platform
  1. Windows
Hi,
is there any way to change the themecolor property to something other than a theme color?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
The query not very clear.

Two (VBA) examples of coloring a cell with red fill without using theme color are:

Activecell.Interior.Color=RGB(255,0,0)
Activecell.Interior.ColorIndex=3
 
Upvote 0
let me try to clear up what i want to do.
in excel 2007 you can have two colors on a format that go from light to dark.. I used the macro recorder to find the code for this, but I havent been able to figure out how to manipulate the color for the 'themecolor' using colorindex or color. Does anyone know how to do this?

Code:
    With Selection.FormatConditions(1).Interior
        .Pattern = xlPatternLinearGradient
       .Gradient.Degree = 90
        .Gradient.ColorStops.Clear
    End With
    With Selection.FormatConditions(1).Interior.Gradient.ColorStops.Add(0)
        .ThemeColor = xlThemeColorAccent1
        .TintAndShade = 0.80001220740379
    End With
    With Selection.FormatConditions(1).Interior.Gradient.ColorStops.Add(1)
        .ThemeColor = xlThemeColorAccent4
        .TintAndShade = 0.599993896298105
    End With
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

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