Results 1 to 3 of 3

Thread: Get Excell Cell color ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Location
    Poland
    Posts
    10

    Get Excell Cell color ?

    Could you possibly explain me or show some part of code:
    How can I get active cell color form Excell sheet.

    Thanks in advance

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    I think its selection.interior.color

    Easiest way is to record a new macro in excel, change the colour of the cell, stop recording and view the code. It should tell you how to get the number for the colour.


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Ecniv is spot on, it's :

    VB Code:
    1. Private Sub CommandButton1_Click()
    2.     MsgBox Cells(1, 1).Interior.Color
    3. End Sub

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

Posting Permissions

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



Click Here to Expand Forum to Full Width