+ Reply to Thread
Results 1 to 2 of 2

Using VBA to return the color of a cell in another column

Hybrid View

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    26

    Using VBA to return the color of a cell in another column

    I have a table of cells that are formatted in different colors, I am looking to return the color index of those colors into another table. If the table goes from A1:G10 and has different background colors, I would like to return a table of color indexes on another tab in A1:G10.

    How do I do that?

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Using VBA to return the color of a cell in another column

    
    Sub test()
    Myrange = Range("A1").CurrentRegion.Address
    If InStr(Myrange, ":") = 0 Then Exit Sub
    T = Split(Myrange, ":")
    
    For c = Range(T(0)).Column To Range(T(1)).Column
    For r = Range(T(0)).Row To Range(T(1)).Row
    Sheets("Sheet2").Cells(r, c).Value = Cells(r, c).Interior.Color
    Next
    Next
    End Sub
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Find name, then return name and column color
    By jokris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2016, 03:58 AM
  2. Return cell background color value
    By GDM69 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-06-2016, 10:51 AM
  3. [SOLVED] Search multiple rows for cell color, return date from same column
    By OceanAngel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2014, 10:07 AM
  4. [SOLVED] if cell in row has color then return text
    By TJ_IE in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2014, 01:31 PM
  5. [SOLVED] Color-format a cell which contains data in a column based on the color of another cell
    By Nit3hawK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2013, 05:25 PM
  6. Match Cell value Return Color
    By jvlkerala in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2011, 02:17 AM
  7. Return a cell value as well as it's background color
    By ysouljah in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-02-2010, 12:32 AM

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