+ Reply to Thread
Results 1 to 10 of 10

Auto Number based on cell colour

  1. #1
    Forum Contributor
    Join Date
    11-10-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2013
    Posts
    297

    Auto Number based on cell colour

    As an example:
    İf;
    A1 cell colour = Red
    A2 cell colour = Blue
    A3 cell colour = Yellow
    A4 cell colour = Green

    I need
    B1 cell value = 1
    B2 cell value = 2
    B3 cell value = 3
    B4 cell value = 4

    I need a macro code which will make automatically this event.

    Cells are example, The code must put the number related to colour to right cell of where is every coloured cell.
    (The coloured cells is NOT next each other , left or right. But up or down)

    Thanks in advance for any reply and help.

    Regards,
    turist.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Auto Number based on cell colour

    Hi Turist - (nice monicker BTW)

    There are 56 color codes on the regular palette if your red,green,blue and yellow are using the basic
    color indices: 3,4,5,6 respectively then you can test for those and load your cell accordingly.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    11-10-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2013
    Posts
    297

    Re: Auto Number based on cell colour

    Quote Originally Posted by xladept View Post
    Hi Turist - (nice monicker BTW)

    There are 56 color codes on the regular palette if your red,green,blue and yellow are using the basic
    color indices: 3,4,5,6 respectively then you can test for those and load your cell accordingly.
    Thanks for prompt reply.
    But, I think your reply is not answer to my question.
    I want to be writen a variable number ( NOT the number of color) to the next right of the colored cell.
    Example if A1 is red , B1 cell will be "1" or any number whic I defined. B1 cell will be auto written by a macro code.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Auto Number based on cell colour

    Hi

    1 way could be this.

    Please Login or Register  to view this content.
    And then using this formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Forum Contributor
    Join Date
    11-10-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2013
    Posts
    297

    Re: Auto Number based on cell colour

    Quote Originally Posted by Fotis1991 View Post
    Hi

    1 way could be this.

    Please Login or Register  to view this content.
    And then using this formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thanks for reply.
    But that is not what I exact wanted.
    Colored cells colud be every Columns. I want to write next cell of colored cell automatically by a code.

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Auto Number based on cell colour

    Put any color in any column you like. Highlight the colored cells. Run this macro.
    Please Login or Register  to view this content.
    Will gives you the number of eatch color in any next cell of any column.

    Good luck.

  7. #7
    Forum Contributor
    Join Date
    11-10-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2013
    Posts
    297

    Re: Auto Number based on cell colour

    Quote Originally Posted by Fotis1991 View Post
    Put any color in any column you like. Highlight the colored cells. Run this macro.
    Please Login or Register  to view this content.
    Will gives you the number of eatch color in any next cell of any column.


    Good luck.
    Thanks a lot for your effort.
    Sorry, but won't work.
    Attached file I did what you said. But NOT worked.

    Please see the attached file.
    Attached Files Attached Files

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Auto Number based on cell colour

    I used Fotis' program to get the indices and then I wrote this:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    11-10-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2013
    Posts
    297

    Re: Auto Number based on cell colour

    Quote Originally Posted by xladept View Post
    I used Fotis' program to get the indices and then I wrote this:

    Please Login or Register  to view this content.
    This is it.
    Works , great.
    Thanks a lot.
    Regards with my Rep.
    turist

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Auto Number based on cell colour

    You're welcome!

+ 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. Locate and colour cell based on a number of criteria in other cells
    By ackp in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-23-2013, 10:05 AM
  2. Replies: 2
    Last Post: 11-29-2012, 11:27 AM
  3. Replies: 1
    Last Post: 05-06-2010, 03:09 AM
  4. How to auto number cells that have colour
    By Ken Wright in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 09:05 AM
  5. How to auto number cells that have colour
    By Dave in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2005, 05:05 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