View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1379_] Rick Rothstein \(MVP - VB\)[_1379_] is offline
external usenet poster
 
Posts: 1
Default If statement / Command Button / Message Box

Consider this alternative to what you asked for and see if it will work for
you. Select the range F3:F4000 (you can do that quickly by entering F3:F4000
into the Name Box... it is to the left of the formula bar). Once selected,
click Format/Conditional Formatting in Excel's menu bar and do the following
in the dialog box that appears.

First, click the Add button two times so that three total conditions are
showing. For each condition, select "Formula Is" in their first drop-down
boxes. Now, click in the second field for Condition 1 and copy/paste this
formula there...

=AND(F3<"",F3<(TODAY()-90))

Now click the Format button for Condition 1 and click on the Patterns tab on
the dialog box that appears. Select a color... I'd suggest the pale red one)
and then click OK to get back to the Conditional Formatting dialog. Now
repeat the process for the other two conditions using this formula in
Condition 2...

=AND(F3<"",F3<(TODAY()-60))

and this formula in Condition 3....

=AND(F3<"",F3<(TODAY()-30))

My suggestion for colors are pale blue for Condition 2 and pale yellow for
Condition 3. When you are through, OK your way back to the worksheet. Any
dates more than 90 days old will be highlighted in pale red; more than 60
day, but less than or equal to 90 days, in pale blue; and more than 30 days,
but less than or equal to 60 days, in pale yellow. This way, you can
immediately identify the status of your accounts by their color (or lack of
it). Note, by the way, that I did not need to use your "today's date" in
L1... Excel has the TODAY() function which generates the current date
automatically.

Rick



"N. McCain" wrote in message
...
I have an invoice tracking sheet. I need to keep up with what customers
have
not paid within 30, 60, and 90 days. I can auto filter and search for
them
myself, but I would like to have a command button that would check today's
date in cell "L1", see if it is greater than all the dates in cells
F3:F4000.
If today's date is greater than any of those dates, I would like to have a
message box that pops up and says "You have invoices that are 30 days past
due." I am reall lost. I have not done any VB programming since college.
Will someone please help me on this?