Help with Code

G

Guest

A little help, please. I keep getting a "Type Mismatch" error. Column I is
formatted as Date.

Private Sub Workbook_Open()

Dim cell As Range

Application.Worksheets(5).Activate

Set rngLate = Range("I2:I65535")
For Each cell In rngLate

If cell.Value <> "" And (cell.Value - Date) <= 2 And cell.Offset(,
-1).Value = "" Then
MsgBox "Order Due" & " " & cell.Offset(, -7).Value & Chr(10) &
cell.Value
End If

Next cell

Application.Worksheets(4).Activate


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Time/date problem. 3
Macro looping problem. 8
Combining Procedures into Loop 3
Run-time error '91' 4
Modify Before Send 10
Code not working 3
e mail same body different subject 3
Criptic VB Code 3

Top