I am attempting to write VBA code that will copy only the table on the sheet and past it into another sheet. I am getting a Run-time error '1004': Method 'Range' of object'_Global' failed. My guess is that I do not have one or more of the references correct. What am I doing wrong? Any help is much appreciated.
This is the code:
Sub Final_Report()
' Final_Report Macro
Sheets("Main Table(Atlas)").Select
Dim rngData As Range
Dim intRow As Integer
Dim intColumn As Integer
intRow = Range("AtlasReport_1_Table_1!11").Row
intColumn = Range("AtlasReport_1_Table_1!1").Column
Set rngData = Worksheets("AtlasReport_1_Table_1").UsedRange
rngData.Offset(intRow - 1, intColumn - 1).Resize(rngData.Rows.Count - intRow + 1, rngData.Columns.Count - intColumn + 1).Select
Selection.Copy
Sheets("Final").Select
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
The debugger is pointing to this line:
intRow = Range("AtlasReport_1_Table_1!11").Row