+ Reply to Thread
Results 1 to 7 of 7

VBA colors

  1. #1
    Registered User
    Join Date
    10-26-2010
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    27

    VBA colors

    I wrote a sub in VBA that displays a set of colors. Now I want the set of colors to output in reverse. Red, Green, Blue, Purple, Yellow output would change to Yellow, Purple, Blue, Green, Red. Been trying to figure it out all morning, but can't seem to get it.

    Please Login or Register  to view this content.
    This is the color output I am trying to show in reverse.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,304

    Re: VBA colors

    Maybe ....

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-26-2010
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: VBA colors

    Tried that already, and still gives me the same color output as the original.
    Last edited by Paul; 10-26-2010 at 05:29 PM. Reason: Removed quote of full previous post

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: VBA colors

    Hello xlsnovice,

    You need to keep the column counter separate from the color index counter. Here are two macros to demonstrate the point.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,304

    Re: VBA colors

    Please Login or Register  to view this content.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,304

    Re: VBA colors

    In fact, you don't need to change to this:

    Please Login or Register  to view this content.


    It just changes the order the cells are filled

  7. #7
    Registered User
    Join Date
    10-26-2010
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: VBA colors

    Quote Originally Posted by Leith Ross View Post
    Hello xlsnovice,

    You need to keep the column counter separate from the color index counter. Here are two macros to demonstrate the point...
    Thank you, works perfect!
    Last edited by Paul; 10-26-2010 at 05:30 PM. Reason: Removed quote of full post

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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