Results 1 to 2 of 2

Thread: Export to Excel

  1. #1
    Join Date
    Oct 2003
    Posts
    58

    Talking Unanswered: Export to Excel

    Hi all,

    I have a process that breaks down and exports particular data from a access query to excel, and i would like to format particular cells in trems of font and cell color.

    I have the code to do this but i do not know the codes for the color ie the "ColorIndex"....

    Excel.Cells(3, 3).Interior.ColorIndex = 12

    does anybody know where i can find the list of available colors and their respective numbers????

    many thanks.

    Jnr.

  2. #2
    Join Date
    Feb 2004
    Location
    Dorset UK
    Posts
    147
    In excel insert a module.

    Then copy and paste this:


    Sub Wonderful_Colours

    Sheets(1).Select

    For a = 0 To 56
    Range("a1").Offset(a, 0).Select
    Range("a1").Offset(a, 0).Value = a
    Range("a1").Offset(a, 0).Interior.ColorIndex = a
    Next

    End Sub


    Theres only 56 colours in the palette, but this should help !



    Ken

Posting Permissions

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