Thread: Help with Code
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
aftamath
 
Posts: n/a
Default Help with Code

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