Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
can I color true or false results differently in excel
I want to identify the day of the week in my spreadsheet and have used the
formula =IF(WEEKDAY(L2)=1,"SU",IF(WEEKDAY(L2)=2,"M",IF(WEE KDAY(L2)=3,"T",IF(WEEKDAY(L2)=4,"W",IF(WEEKDAY(L2) =5,"TH",IF(WEEKDAY(L2)=6,"F",IF(WEEKDAY(L2)=7,"SA" ,""))))))) where the L2 cell would have a date (ie 04/10/2008) but would like the weekdays (M-F) to be black and have SA and SU come up red. any ideas / suggestions? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
can I color true or false results differently in excel
What about just using conditional formatting?
Mark Ivey "JT" wrote in message ... I want to identify the day of the week in my spreadsheet and have used the formula =IF(WEEKDAY(L2)=1,"SU",IF(WEEKDAY(L2)=2,"M",IF(WEE KDAY(L2)=3,"T",IF(WEEKDAY(L2)=4,"W",IF(WEEKDAY(L2) =5,"TH",IF(WEEKDAY(L2)=6,"F",IF(WEEKDAY(L2)=7,"SA" ,""))))))) where the L2 cell would have a date (ie 04/10/2008) but would like the weekdays (M-F) to be black and have SA and SU come up red. any ideas / suggestions? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
can I color true or false results differently in excel
Paste this code into the worksheet that your formula is in
Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Range("B2") Select Case .Value Case "M", "T", "W", "TH", "F" .Interior.ColorIndex = 1 .Font.ColorIndex = 2 Case "SA", "SU" .Interior.ColorIndex = 3 .Font.ColorIndex = 2 Case Else .Interior.ColorIndex = 2 .Font.ColorIndex = 1 End Select End With End Sub "JT" wrote: I want to identify the day of the week in my spreadsheet and have used the formula =IF(WEEKDAY(L2)=1,"SU",IF(WEEKDAY(L2)=2,"M",IF(WEE KDAY(L2)=3,"T",IF(WEEKDAY(L2)=4,"W",IF(WEEKDAY(L2) =5,"TH",IF(WEEKDAY(L2)=6,"F",IF(WEEKDAY(L2)=7,"SA" ,""))))))) where the L2 cell would have a date (ie 04/10/2008) but would like the weekdays (M-F) to be black and have SA and SU come up red. any ideas / suggestions? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
can I color true or false results differently in excel
I think that both of you guys are WAY ABOVE my programming level. Thanks for
the help but I think I should have put my question in the beguinners category since I really don't know what conditional formatting is let alone how to do it. sorry to waste your time. JT |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
can I color true or false results differently in excel
I think that both of you guys are WAY ABOVE my programming level. Thanks for
the help but I think I should have put my question in the beguinners category. I have tried to copy the subroutine that you sent to several cells in my worksheet and either get text of the subroutine or, if I start it with "=" and the subroutine all in one cell, excell calls an error and highlights the term ".value" in the subroutine. I have also tried messing with the With Range("B2") line and tried both With Range(O20) {a cell that is Saturday} and With Range(O2:O32) {the 31 cells to correspond to the 31 possible dates per month} and had no luck. Thanks for the effort. sorry to waste your time. JT |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
can I color true or false results differently in excel
Strike my reply to your answer Mark. I just found a link to conditional
formating and, WOW, what a powerful tool. Great suggestion! Now my weekdays are black with Green background and the weekends are white with red backgrounds. More than I had in mind. If I did this right the link that I followed was http://www.contextures.com/xlCondFormat01.html if not, then this is the webpage I used. (Like I said, I am not much of a programmer, typical 52 year old who didn't get his first computer till he was 40'ish) Thanks again Mike. JT |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What's the best way to toggle between true and false in Excel? Hiall, My excel work involves a lot of toggling between true and false (booleantypes) ... and it's very repetitive... Is there a way to select a bunch ofcells, and press a key short-cu | Excel Discussion (Misc queries) | |||
Indexing/Matching True/False results | Excel Worksheet Functions | |||
Convert TRUE/FALSE results to a number | Excel Worksheet Functions | |||
How can I make a True or False statement a certain color when usi. | Excel Worksheet Functions | |||
Adding True False Results | Excel Worksheet Functions |