Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default colouring cells that are between two dates

I have the following code and it works fine.

If ((cell.Value = DateValue("01/11/05")) And (cell.Value <
DateValue("01/12/05"))) And (IsDate(cell.Value)) Then
cell.Interior.ColorIndex = 4

The date values are fixed in the code but I want to pick the date
values from two cells on the sheet. I cannot seem to make it work.
Anyone haave aany ideaas?

Cheers,

Ian.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default colouring cells that are between two dates

If ((cell.Value = Range("B9").Value) And (cell.Value <
Range("B10").Value)) And (IsDate(cell.Value)) Then
cell.Interior.ColorIndex = 4

--
Regards,
Tom Ogilvy

"Ian" wrote in message
...
I have the following code and it works fine.

If ((cell.Value = DateValue("01/11/05")) And (cell.Value <
DateValue("01/12/05"))) And (IsDate(cell.Value)) Then
cell.Interior.ColorIndex = 4

The date values are fixed in the code but I want to pick the date
values from two cells on the sheet. I cannot seem to make it work.
Anyone haave aany ideaas?

Cheers,

Ian.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default colouring cells that are between two dates

On Tue, 6 Sep 2005 15:32:47 -0400, "Tom Ogilvy"
wrote:

If ((cell.Value = Range("B9").Value) And (cell.Value <
Range("B10").Value)) And (IsDate(cell.Value)) Then
cell.Interior.ColorIndex = 4



Thanks Tom, as ever you have the solution. I nearly got there
but but got confused with using the datevalue.

Thanks again,

Ian,
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
Excel Macro for colouring cells Flash Excel Discussion (Misc queries) 2 July 13th 06 06:18 PM
Automatic colouring of cells Hustler24 Excel Discussion (Misc queries) 2 June 28th 06 09:18 AM
Automatic colouring of cells plf100 Excel Worksheet Functions 3 March 29th 06 03:10 PM
How to apply colouring as in Cells associated with Forumla news.microsoft.com[_8_] Excel Programming 7 July 31st 05 05:42 AM
Colouring cells Sam A Excel Programming 2 August 17th 04 03:27 PM


All times are GMT +1. The time now is 11:50 PM.

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"