Consulting

Results 1 to 8 of 8

Thread: Solved: Help with conditional formatting

  1. #1
    VBAX Regular
    Joined
    Jan 2013
    Posts
    8
    Location

    Solved: Help with conditional formatting

    I am new to using VBA and I'm hoping someone may help.

    This seems to be simple but.....

    I have a worksheet in Excel 2010 that has all the days of the year (ex. 1/1/13) down column A and the corresponding days of the week (ex. Monday) down column B.

    What I need is if the days of the week are Saturday and Sunday (in this example cells B5 & B6) then I need the cells directly to the left (in this case cells A5 & B5) have a background color of gray AND the 7 cells directly to the right (in this case cells C5 thru I5 and C6 thru I6) to have a background color of gray.

    It seems pretty straight forward but I just can't figure it out.

    I have attached a simple file of what it should look like.

    If anyone can help, I would be greatly appreciative.
    Attached Files Attached Files

  2. #2
    VBAX Contributor GarysStudent's Avatar
    Joined
    Aug 2012
    Location
    Lakehurst, NJ, USA
    Posts
    127
    Location
    Please give the attached a try.
    Attached Files Attached Files
    Have a Great Day!

  3. #3
    VBAX Regular
    Joined
    Jan 2013
    Posts
    8
    Location
    Thank you GarysStudent for the file (very appreciative!!) but when I opened the file all the cells have a white background. All the dates and days are listed, but all have white backgrounds. Am I doing something wrong??

  4. #4
    VBAX Regular
    Joined
    Jan 2013
    Posts
    8
    Location
    And when I open your spreadsheet and click Macros and choose to Run yours, still nothing happens.

  5. #5
    VBAX Regular
    Joined
    Jan 2013
    Posts
    8
    Location
    Oops I'm sorry - yes it did work. Not sure what I clicked wrong, but it does work!! Thank you so much!!!!!!!!!!!!!

  6. #6
    VBAX Contributor GarysStudent's Avatar
    Joined
    Aug 2012
    Location
    Lakehurst, NJ, USA
    Posts
    127
    Location
    You are quite welcome!
    Have a Great Day!

  7. #7
    VBAX Regular
    Joined
    Jan 2013
    Posts
    8
    Location
    GaryStudent - one last question, if you will. I noticed that your script works on the current worksheet. How can I get that script to work on multiple worksheets within the excel file?? Thank you again

  8. #8
    VBAX Regular
    Joined
    Jan 2013
    Posts
    8
    Location
    I found out why it did not work on all sheets - Thank you again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •