Opv
03-09-2010, 07:54 PM
Can someone please tell me why the code below runs flawlessly on Excel 2000 and causes an error on Excel 2002, running on Windows XP, Service Pack3? What needs to be changed to make it work on any version of Excel?
Opv
Sub Auto_Open()
' Auto_Open Macro
' Macro recorded 2/12/2010 by John Q. Doe
'
MyRows = Range("Date").Cells.SpecialCells(xlCellTypeBlanks).Count
If MyRows <= 3 Then
Call InsertRow
Application.CutCopyMode = False
End If
rptMonth = Range("ReportMonth").Value
forMonth = Application.Max([B:B])
If rptMonth <> forMonth Then
Range("ReportMonth").ClearContents
Range("ReportMonth").Value = forMonth
End If
End Sub
Opv
Sub Auto_Open()
' Auto_Open Macro
' Macro recorded 2/12/2010 by John Q. Doe
'
MyRows = Range("Date").Cells.SpecialCells(xlCellTypeBlanks).Count
If MyRows <= 3 Then
Call InsertRow
Application.CutCopyMode = False
End If
rptMonth = Range("ReportMonth").Value
forMonth = Application.Max([B:B])
If rptMonth <> forMonth Then
Range("ReportMonth").ClearContents
Range("ReportMonth").Value = forMonth
End If
End Sub