+ Reply to Thread
Results 1 to 6 of 6

Scheduler and Conditional Formatting

  1. #1
    Registered User
    Join Date
    09-12-2006
    Posts
    4

    Scheduler and Conditional Formatting

    I was wondering if someone might be able to help me out with something I can't manage to get my head round. I'm not sure if this is the right to be posting this thread - I've a feeling though that the problem may only be able to be solved using VBA.
    I'm creating a work scheduler in Excel 2004 - 2 linked sheets covering half a year each with a month overlap from the first sheet to the second sheet.
    The formatting of the diary elements all hang off the cell containing the first date - i.e. cell A3 = 01/01/2006.
    What I'd like to do do is get all the cells in the rows directly below each date cell to look at cell A3 to get their formatting. At the moment I have the following condition formatting to run against each cell within the schedule:

    Condition 1:
    Please Login or Register  to view this content.
    then font colour = X and pattern colour = Y
    Condition 2:
    Please Login or Register  to view this content.
    then font colour = X and pattern colour = Z
    Condition 3:
    Please Login or Register  to view this content.
    then font colour = W and pattern colour = none

    I can copy the conditional formatting horizontally without any problem but when I try to copy vertically it screws up as the next cell down in the schedule is trying to get its formatting from the cell A4 which has no date and results in no formatting
    Bascially I need each of the cells in a column to reference the one header cell (all column A cells to reference cell A3 for example). It would be great if the whole of the formatting for all cells could hang off the first date cell - but I expect that is asking too much.

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    You need to reference cell A3 absolutely. Meaning you need to use A$3 so that you can copy the formatting to the right and down and the row number will not change. If you want to base it off of cell A3 for everthing the use $A$3 in your formulas
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

  3. #3
    Registered User
    Join Date
    05-02-2006
    Posts
    80
    To further elucidate put these in for your conditional formatting. As Excelenator says adding in the "$" symbol locks the referencing point. $A3 locks the A colyumn, A$3 would lock the 3 row and $A$3 lockes both the column and the row, i.e. the cell itself. Does that make any sense? No matter try inserting the below into your conditional formatting:

    Condition 1:

    Please Login or Register  to view this content.
    then font colour = X and pattern colour = Y

    Condition 2:

    Please Login or Register  to view this content.
    then font colour = X and pattern colour = Z

    Condition 3:

    Please Login or Register  to view this content.
    then font colour = W and pattern colour = none

    They paste the formatting as you would normally.

  4. #4
    Registered User
    Join Date
    09-12-2006
    Posts
    4
    Thanks for your replies, guys. Maybe I didn't explain clearly enough what I am trying to achieve. So I'll try to give you a clearer idea:

    I've got a row of dates 1/1/2006 ... 31/12/2006 in row starting in A3

    Below I've got a line for each employee - Rows 6 ... 26. When I copy and paste the formatting for cell A6 across the width I want it to reference the date at the top of the relevant column i.e. cell D6 should reference cell D3, cell F12 should reference cell F3, etc.

    What you have suggested, Tristan, works but means I have to manually change the conditional formatting on the first employee row for each cell across the full width - tedious, but workable!

    Is there any way I can do this to avoid the chore?

    Thanks again.

  5. #5
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    If you highlight the entire range of rows and columns that you want to conditionally format and set the conditions as follows:

    1st
    Cell Value >0

    2nd
    Formula Is = OR(WEEKDAY(A$3)=1, WEEKDAY(A$3)=7)

    3rd
    Cell Value <=0

    You should get the disired result. The dollar sign "absolutes" the row number so that all cells will reference row 3 and whatever column they are in.




    Quote Originally Posted by spacemonkey
    Thanks for your replies, guys. Maybe I didn't explain clearly enough what I am trying to achieve. So I'll try to give you a clearer idea:

    I've got a row of dates 1/1/2006 ... 31/12/2006 in row starting in A3

    Below I've got a line for each employee - Rows 6 ... 26. When I copy and paste the formatting for cell A6 across the width I want it to reference the date at the top of the relevant column i.e. cell D6 should reference cell D3, cell F12 should reference cell F3, etc.

    What you have suggested, Tristan, works but means I have to manually change the conditional formatting on the first employee row for each cell across the full width - tedious, but workable!

    Is there any way I can do this to avoid the chore?

    Thanks again.

  6. #6
    Registered User
    Join Date
    05-02-2006
    Posts
    80
    Hmmm...

    Pretty sure what I suggested above should work. It does on mine and I don't have to manually change the formatting for each date.

    How are you copying your formatting over. Do you use the format painter to do it? It's the brush icon on your toolbar?

    Honestly this does work. Enter what was written above into the conditional formattting for cell A6, making sure you've got the "$" symbols in the right place. Then click the paintbrush icon and drag across all the cells you want the formatting to apply to.

    Good luck

    Tris

+ 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