ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro for Condicitional Format (https://www.excelbanter.com/excel-programming/416142-macro-condicitional-format.html)

Wskip

Macro for Condicitional Format
 
I need to highlight between dates.
example: 9/1/2002 to 9/1/2008
9/1/2001 to 9/1/2008
9/1/2000 to 9/1/2008
I've tried to write a macro using case 1 , case 2 but to no avail.


Bob Bridges[_2_]

Macro for Condicitional Format
 
Before talking about the method, today's date falls in all three of those
ranges; so which type of highlighting should it receive? Seems to me you
must correct your ranges:

before 2000-09-01
2000-09-01 through 2001-08-31
2001-09-01 through 2002-08-31
2002-09-01 through 2008-08-31
2008-01-09 and beyond

What's it to be? If you need to distinguish between only four different
ranges you don't need a program at all; you can use Conditional Formatting
(which see as an option under Format on the menu bar). That allows three
special formats for each of three special conditions (the fourth being the
normal format, you see). You can look up Conditional Formatting in the
documentation, and/or ask questions about it in the Excel Worksheet Functions
forum.

If you need more than that, you'll have to write a VBA program, in which
case you can continue the question here, after elaborating a bit.

--- "Wskip" wrote:
I need to highlight between dates.
example: 9/1/2002 to 9/1/2008
9/1/2001 to 9/1/2008
9/1/2000 to 9/1/2008
I've tried to write a macro using case 1 , case 2 but to no avail.



All times are GMT +1. The time now is 10:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com