Variable not Defined Compile error
Do you have a worksheet that has a codename of Sheet2?
Did you really mean to put that address in 8 cells (b2:i2)?
Paul3rd wrote:
Hello, This code triggers a compile error, variable not defined.
Sheet2 is the culprit, how can I correct this?
Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
Sheet2.Range("B2:I2") = Sheet1.UsedRange.Address
Application.DisplayAlerts = True
End Sub
Thanks in advance for any help.
Paul
--
Dave Peterson
|