Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: ColourIndex not working

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    can anyone tell me why

    Application.Goto reference:="DOCUMENTS"
    With Selection.Interior
    .ColorIndex = 40
    .Pattern = xlSolid
    End With

    won't work when

    Application.Goto reference:="DOCUMENTS"
    With Selection.Interior
    .ColorIndex = 3
    .Pattern = xlSolid
    End With

    does work? It's a from of error checking. Highlights an area in red if the values are incorrect, but I need to set it back to clear via an initialisation sub. I tried xlColorIndexNone, but that doesn't work either. I get error 1004 - unable to set the ColorIndex of the interior class.

  2. #2
    New Member
    Join Date
    Mar 2002
    Posts
    39
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    To set it back to clear use

    Application.Goto reference:="DOCUMENTS"
    With Selection.Interior
    .ColorIndex = xlnone
    .Pattern = xlnone
    End With

    Russell

  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    ok, I tried that, but get same error message, but also the value of xlNone is now -4142 at the code break point. Is that correct?

  4. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sunny, spring-like Hull
    Posts
    3,339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Does xlColorIndexAutomatic work?

Some videos you may like

User Tag List

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
  •