Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default 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   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default 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   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
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 LunaMoon Excel Discussion (Misc queries) 9 July 29th 08 12:28 AM
Indexing/Matching True/False results drvortex Excel Worksheet Functions 5 November 29th 05 01:09 AM
Convert TRUE/FALSE results to a number pomalley Excel Worksheet Functions 5 March 16th 05 05:45 PM
How can I make a True or False statement a certain color when usi. Wendy Excel Worksheet Functions 1 January 28th 05 05:55 PM
Adding True False Results Arla M Excel Worksheet Functions 6 January 27th 05 06:29 PM


All times are GMT +1. The time now is 02:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"