R
RyanH
I am getting a Type Mismatch Error on the Line indicated below. I want to
return the Range of the PrintArea on Sheet1. Any one have any ideas.
Sub Macro1()
Dim myPrintArea As Variant
Dim LastRow As Long
Dim LastCol As Long
ERROR => Set myPrintArea = Sheets("Sheet1").PageSetup.PrintArea
LastRow = myPrintArea.Rows(myPrintArea.Rows.Count).Row
LastCol = myPrintArea.Rows(myPrintArea.Columns.Count).Column
MsgBox Cells(LastRow, LastCol).Address
End Sub
Thanks in Advance.
return the Range of the PrintArea on Sheet1. Any one have any ideas.
Sub Macro1()
Dim myPrintArea As Variant
Dim LastRow As Long
Dim LastCol As Long
ERROR => Set myPrintArea = Sheets("Sheet1").PageSetup.PrintArea
LastRow = myPrintArea.Rows(myPrintArea.Rows.Count).Row
LastCol = myPrintArea.Rows(myPrintArea.Columns.Count).Column
MsgBox Cells(LastRow, LastCol).Address
End Sub
Thanks in Advance.