I am trying to use the messagebox function for the first time with no luck. I am hoping I can get some help.
My program imports data everyday with 2 years worth of data. What I am trying to do is check the first cell of the last row and if that is not today's date I want the program to do is not save the file and give me a message saying that the current file is not being saved.
My program imports data everyday with 2 years worth of data. What I am trying to do is check the first cell of the last row and if that is not today's date I want the program to do is not save the file and give me a message saying that the current file is not being saved.
Code:
LR = ActiveSheet.UsedRange.Rows.Count
COde .....
LR1 = LR - 1
If Range("A" & LR1).Value < Date Then MsgBox(Prompt,vbInformation,"This file will not be saved") next lcount
wbResults.Close SaveChanges:=True
Next lCount