PDA

View Full Version : Solved: Need reminder for previous day



marc5051
11-08-2011, 12:47 PM
Hi All..

here i am looking for date reminder for current and previous day.
here is the code for current day reminder. but don't know what to do reminder for previous day (YESTERDAY).

any help or suggestion is most appreciated.

...Marc

Option Explicit
Dim cl As Range

Private Sub ListBox1_Click()
Set cl = Sheet1.UsedRange.Find(Me.ListBox1.Value, LookIn:=xlValues)
cl.Select
End Sub

Private Sub UserForm_Initialize()
Dim rDates As Range

Me.Caption = "appointments due: " & Format(Date, "long date")

With Sheet1
Set rDates = .Range(.Cells(3, 2), .Cells(.Rows.Count, 2).End(xlUp))
End With

For Each cl In rDates
If cl.Value = Date Then Me.ListBox1.AddItem cl.Offset(0, -1).Value
Next cl
End Sub

mdmackillop
11-08-2011, 01:08 PM
Welcome to VBAX
I'm not clear what you're trying to do, but how about "Date -1"

marc5051
11-08-2011, 01:31 PM
Hello Mr. Mdmackillop

the above given code pop up the message for current due date i.e.: 11/08/2011.
meantime i want to pop up the message for previous due date (overdue date), i.e. 11/07/2011.

...Marc

mdmackillop
11-08-2011, 01:46 PM
Can you post a sample workbook. Use Manage Attachments in the Go Advanced reply section

marc5051
11-08-2011, 02:05 PM
Hi..

Please find attached file for your reference.

...Marc

mdmackillop
11-08-2011, 02:27 PM
Maybe you can extract what you need from this

marc5051
11-08-2011, 02:35 PM
yes Sir...,

This is what i want exactly....

Thank you very much for your kind help..:)

...Marco