ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checking if something is past due (https://www.excelbanter.com/excel-programming/376446-checking-if-something-past-due.html)

Jonathan

Checking if something is past due
 
I'm adding a function to an old Excel Macro. Basically, if Column H contains
Open and the date in Column C has passed, he wants the row to highlight
yellow. How do you check to see if a date has passed?

Bob D

Checking if something is past due
 
Are you comparing dates in column C with a variable date input or just
today's date? Do the dates in column C include only dates in the past or do
they include future dates?

When you say "Open" for column H, are you referring to a stock price or the
text "Open"?

"Jonathan" wrote in message
...
I'm adding a function to an old Excel Macro. Basically, if Column H
contains
Open and the date in Column C has passed, he wants the row to highlight
yellow. How do you check to see if a date has passed?




Albert

Checking if something is past due
 
This should do the trick.

If Cells(Row, 8) = "Open" Then
If VBA.DateValue(Cells(Row, 3)) VBA.Now Then
Cells(Row, 3).EntireRow.Interior.ColorIndex = 6
End If
End If

"Jonathan" wrote:

I'm adding a function to an old Excel Macro. Basically, if Column H contains
Open and the date in Column C has passed, he wants the row to highlight
yellow. How do you check to see if a date has passed?



All times are GMT +1. The time now is 02:47 PM.

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