+ Reply to Thread
Results 1 to 8 of 8

Random color conditional formating

  1. #1
    Registered User
    Join Date
    11-01-2016
    Location
    Prague
    MS-Off Ver
    2016
    Posts
    19

    Random color conditional formating

    Hello everyone,
    so lets say I got a big amount of different political parties in a list. And I need them to format so every political party will have its own color. So I would need to randomly color every cell in that list based on what is in it so if I shuffle them in that list the party will still have same color. I would also need cells with values to copy the color of cell with party. Is there a way to do it? And if so is it possible to set color of some political parties by hand and other just randomly color?
    I hope you understand what I am trying to do. Thank you.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-07-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256

    Re: Random color conditional formating

    Clik on any political party and see whether you like this
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-01-2016
    Location
    Prague
    MS-Off Ver
    2016
    Posts
    19

    Re: Random color conditional formating

    Thank you so much for reply.
    I think it might. Is it possible to make the macro so it wouldnt change the colors all the time?

  4. #4
    Registered User
    Join Date
    09-09-2013
    Location
    Iran
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Random color conditional formating

    Hi
    Definitely there are better ways i added some lines to catchnanan's code.
    Here u are :
    Please Login or Register  to view this content.
    if you want you can limit the colors!here 55 colors are using...!
    Last edited by rahi_feri; 11-25-2016 at 11:53 AM.
    Islam = Peace
    Shia = Peace
    Iran = Peace

  5. #5
    Registered User
    Join Date
    11-01-2016
    Location
    Prague
    MS-Off Ver
    2016
    Posts
    19

    Re: Random color conditional formating

    Quote Originally Posted by rahi_feri View Post
    Hi
    Definitely there are better ways i added some lines to catchnanan's code.
    Here u are :
    Please Login or Register  to view this content.
    if you want you can limit the colors!here 55 colors are using...!
    It works nicely. I wanted to ask a question. Would it be possible to restrict this macro from using lets say 10 specific colors? Ty very much

  6. #6
    Registered User
    Join Date
    09-09-2013
    Location
    Iran
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Random color conditional formating

    Hi
    Yeah
    See the colors and choose them!
    https://msdn.microsoft.com/en-us/lib.../ff840443.aspx
    http://dmcritchie.mvps.org/excel/colors.htm

    If You choose them in row you can use this code and just should change the numbers but if u choose them randomly, it will need another code...!
    Last edited by rahi_feri; 11-26-2016 at 11:03 AM.

  7. #7
    Registered User
    Join Date
    11-01-2016
    Location
    Prague
    MS-Off Ver
    2016
    Posts
    19

    Re: Random color conditional formating

    Quote Originally Posted by rahi_feri View Post
    Hi
    Yeah
    See the colors and choose them!
    https://msdn.microsoft.com/en-us/lib.../ff840443.aspx
    http://dmcritchie.mvps.org/excel/colors.htm

    If You choose them in row you can use this code and just should change the numbers but if u choose them randomly, it will need another code...!
    So if I wanted to exclude colors from 41 to 56, I would just write number 40 in the code instead of 56?

  8. #8
    Registered User
    Join Date
    09-09-2013
    Location
    Iran
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Random color conditional formating

    Yeah, that's right

+ 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] Wasn't able to color the whole row with Conditional Formating
    By hellforce in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-13-2014, 07:31 AM
  2. [SOLVED] Trouble with Two conditional formating IFcell>0=color or IF cell blanck=color
    By Jeff up North in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-07-2013, 08:12 PM
  3. [SOLVED] Conditional formating and worksheet tab color
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-24-2012, 10:09 AM
  4. [SOLVED] VBA for conditional formating and color sorting
    By juskojj in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-11-2012, 02:49 PM
  5. Copy Color of a Conditional Formating Cell, Not Value
    By bmccarthy in forum Excel General
    Replies: 6
    Last Post: 10-14-2010, 06:28 PM
  6. Color Formating on random like values
    By Mike_Ert in forum Excel General
    Replies: 4
    Last Post: 10-08-2010, 12:20 PM
  7. Conditional Formating - Change Color
    By hfazal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2006, 02:45 PM

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