Hi there, I need a VBA to be used in Excel to check a couple of columns (F:F, H:H, N:N) to see if any cell in those columns contain a date that is greater than today and pop up a message. Could you please help?
When it finds the future dates the first time it pops up a message and then any data entry whether it is text or date in any cell triggers the message to pop-up!
I want it to pop-up once any time a future date is entered in columns F, H, and M.
When it finds the future dates the first time it pops up a message and then any data entry whether it is text or date in any cell triggers the message to pop-up!
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Len(ThisWorkbook.Names("FutureDate").Name) > 0 Then DoEvents
If Err <> 0 Then ThisWorkbook.Names.Add Name:="FutureDate", RefersTo:=False
On Error GoTo 0
If ThisWorkbook.Names("FutureDate").RefersTo = "=FALSE" Then
If Application.WorksheetFunction.Max(Columns("F"), Columns("H"), Columns("N")) > Date Then
ThisWorkbook.Names("FutureDate").RefersTo = True
MsgBox "Please check your dates"
End If
End If
End Sub
If you want some other variation please modify to suit.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.