Results 1 to 4 of 4

changing the color pattern of a cell in vba

This is a discussion on changing the color pattern of a cell in vba within the Excel Questions forums, part of the Question Forums category; Hi, is there any way to change the themecolor property to something other than a theme color?...

  1. #1
    Board Regular
    Join Date
    Aug 2008
    Posts
    111

    Default changing the color pattern of a cell in vba

    Hi,
    is there any way to change the themecolor property to something other than a theme color?

  2. #2
    Board Regular
    Join Date
    Apr 2002
    Location
    India
    Posts
    627

    Default Re: changing the color pattern of a cell in vba

    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

  3. #3
    Board Regular
    Join Date
    Aug 2008
    Posts
    111

    Default Re: changing the color pattern of a cell in vba

    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

  4. #4
    Board Regular
    Join Date
    Apr 2002
    Location
    India
    Posts
    627

    Default Re: changing the color pattern of a cell in vba

    May not be relevant but you might like to see:
    http://spreadsheetpage.com/index.php...vba_challenge/

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com