+ Reply to Thread
Results 1 to 7 of 7

Adjust Color Properties

  1. #1
    Registered User
    Join Date
    01-07-2008
    Posts
    65

    Adjust Color Properties

    I don't really know a lot about programing in excel, but I would like to take all of the border colors in a sheet and change the lumens and saturation to the same value, and I would like to do the same with the fill properties (only with a different value). I want to do this repeatedly, so I need some sort of automated method. Any suggestions?

    Thanks,
    Justin

  2. #2
    Registered User
    Join Date
    01-07-2008
    Posts
    65

    Re: Adjust Color Properties

    I should also mention I'm using excel 2007.

    Maybe another idea would be to use a script that uses the values of the top three cells to populate the values of the border color of the entire column (row 1 - hue, row 2 - sat, row 3 - lum), and then the next three cells to populate the values of the fill color. This would work for me as long as the colors will only be changed when the script is run manually, because I can't leave the color properties as the values of the top 6 rows.

  3. #3
    Registered User
    Join Date
    01-07-2008
    Posts
    65

    Re: Adjust Color Properties

    I see a few people have looked. Usually I get a response almost immediately. So, I think I might be asking for too much work to be done for me. I tried to create a macro with the "record macro" tool.

    Please Login or Register  to view this content.
    All this does is make every cell I apply the macro to turn the color of the original cell I adjusted while recording the macro.

    I would like, first of all, to be able to access Hue Saturation Lumen values of a fill or border. Then I would like to change one or more of the HSL at a time while leaving the other value(s) unchanged from the properties that existed before the macro was run.

    Basically I have a template that uses a series of colored columns. The order of the hue is already set and will be the same in every other sheet I create. Within the sheet the saturation and lumens values are the same for every color (Sat 255, Lum 128). I want to create copies of this template with varying levels of saturation and lumens (still the same values within the same sheet). I don't mind having to go into the code of a macro and change the values of the saturation and lumens before I run it. I just don't know how to even refer to those properties at all. I don't even know how to refer to the fill or the borders. Any info will help.

    Thanks again,
    Justin

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Adjust Color Properties

    You probably need to convert those HSL values to an RGB value. This should give you a start.
    http://www.xbeat.net/vbspeed/c_HSLToRGB.htm
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    01-07-2008
    Posts
    65

    Re: Adjust Color Properties

    I would be willing to do that except for the fact that all the fills on the screen need to have the same sat and lum. So with HSL it would be one number for the entire page and would take no more than a minute. It seems like with the code on the site you suggested, I would have to specify the exact color. In otherwords I would not be able to leave the Hue unchanged. Am I understanding this correctly?

    Thank you so much for your reply,
    Justin

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Adjust Color Properties

    You would need to determine the hue before setting the HSL and converting to RGB in order to apply the changes.

    Can you not make use of the Office colour themes to do the changes you require?

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Adjust Color Properties

    Put three rectangles on a sheet (Rectangle 1/2/3).

    Fill each with some arbitrary color. The code below converts 2 and 3 to have the same saturation and luminance as the first, without changing their hue:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ 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