+ Reply to Thread
Results 1 to 6 of 6

color code

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-24-2006
    Location
    INDIA
    MS-Off Ver
    office 2010
    Posts
    190

    color code

    Hi,

    can any one help me,

    how to write macro for color code - Gold and Aqua color

    Like: green - vbgreen

    Regards
    sagar

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Run this code on a blank sheet to see the index number for each color.
    Sub interior_colors()
        Dim i As Integer
        For i = 1 To 56
            With Cells(i, 1)
                .Interior.ColorIndex = i
                .Offset(0, 1) = i
            End With
        Next
    End Sub
    Then, when you know which index number to use, here is the code to color a cell:
    Selection.Interior.ColorIndex = 3
    or
    Range("A1:A10").Interior.ColorIndex = 3
    HTH

    Jason

  3. #3
    Forum Contributor
    Join Date
    10-24-2006
    Location
    INDIA
    MS-Off Ver
    office 2010
    Posts
    190
    thank you very much Jason

    Regards
    Sagar

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    No problem, Sagar.

  5. #5
    Registered User
    Join Date
    09-11-2006
    Posts
    56
    Jasoncw, many many thanx, I have a color code chooser that I use with my phone log different colors indicate whether an event is complete or pending or whatever until now I have had to resort to trial and error finding the color code I wanted to use. Again Many thanx. I do love this forum.
    "There are 10 kinds of people in the world, Those that understand binary, and those that don't."

  6. #6
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Glad to help. Actually, I remembered this code from reading the board a few weeks ago. I received the knowledge, and just passed it on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1