I have an Excel workbook which runs a few macros to collect data from some other Excel workbooks.
One of the macros basically is meant to select rows of data to copy over. What I have tried to do below is to select all rows that have data in (as some of the sheets from which the data is being copied from will have 1 row of data, others will have 3, etc etc).
Code:
Sub CallData() ' ' CallData Macro ' ' Sheets("Ignore-this-sheet").Select FinalRow = Range("A65536").End(xlUp).Row Range("A1:DP & FinalRow").Select Selection.Copy Windows("Master Template 2.xls").Activate Sheets("extracts").Select Rows("3:3").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Rows("3:3").Select Selection.Insert Shift:=xlDown End SubBut I get an error msg:
Run-time error '1004':
Method 'Range' of object '_Global' failed
and the debugger points to the line:
Code:
Range("A1:DO & FinalRow").Select
Any suggestions on how I could fix the problem??
Many thanks!!
DP