#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
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Help with Code

Make sure that all cell.Value are numeric
--
Gary's Student


"aftamath" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change case...help please Terry Excel Worksheet Functions 14 October 2nd 05 12:29 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM
Opening a file with code without a set file name jenkinspat Excel Discussion (Misc queries) 1 March 4th 05 10:50 AM


All times are GMT +1. The time now is 11:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"