I am new to VBA and I had the following one set-up:
Private Sub Workbook_Open()
MsgBox "Notify Customer 90 days prior to deadline"
MsgBox "Notify Customer when travel has exceeded 75%"
End Sub
However, the notifications were popping every time I open the worksheet and that was not effective. So I asked for help with the following:
1. I would like to add a condition for it to open only 90 days prior to cell C3 (assuming cell C3 has a date).
2. Assuming cell F3 contains the funding amount, I would like for the notification to pop only when it has reached 75% of cell F3.
And after several exchanges with a fellow member, he or she suggested I used the following:
Private Sub Workbook_Open()
If Sheets(1).Range("C3").Value - Date <= 93 And _
Sheets(1).Range("C3").Value >= 90 Then
MsgBox "Notify Customer 90 days prio to Deadline"
End If
If 'it' / Sheets(1).Range("F3").Value >= .75 Then
MsgBox "Notify Customer when travel has exceeded 75%"
End If
End Sub
The logic behind 93 days was in case 90 days fell on a weekend but I can't get it to work. Instead, I am getting the following error:
Rum-time error '13':
Type mismatch
What exactly does this mean and how can I fix it for both notifications to pop?
Thank you.
Private Sub Workbook_Open()
MsgBox "Notify Customer 90 days prior to deadline"
MsgBox "Notify Customer when travel has exceeded 75%"
End Sub
However, the notifications were popping every time I open the worksheet and that was not effective. So I asked for help with the following:
1. I would like to add a condition for it to open only 90 days prior to cell C3 (assuming cell C3 has a date).
2. Assuming cell F3 contains the funding amount, I would like for the notification to pop only when it has reached 75% of cell F3.
And after several exchanges with a fellow member, he or she suggested I used the following:
Private Sub Workbook_Open()
If Sheets(1).Range("C3").Value - Date <= 93 And _
Sheets(1).Range("C3").Value >= 90 Then
MsgBox "Notify Customer 90 days prio to Deadline"
End If
If 'it' / Sheets(1).Range("F3").Value >= .75 Then
MsgBox "Notify Customer when travel has exceeded 75%"
End If
End Sub
The logic behind 93 days was in case 90 days fell on a weekend but I can't get it to work. Instead, I am getting the following error:
Rum-time error '13':
Type mismatch
What exactly does this mean and how can I fix it for both notifications to pop?
Thank you.