Johnny C
Well-known Member
- Joined
- Nov 7, 2006
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
Hi
I'm trying to copy from a template to a worksheet object, but am getting a "Method 'Range' of object '_Worksheet' failed" error (1004)
It has no problem setting the name, why can't I use a range with it?
Cheers
I'm trying to copy from a template to a worksheet object, but am getting a "Method 'Range' of object '_Worksheet' failed" error (1004)
It has no problem setting the name, why can't I use a range with it?
Code:
Set QueryOutputWkSht = Sheets.Add
QueryOutputWkSht.Name = "Query Log"
strQueryLogRangeRefOutput = "$A$1:" & Cells(9, wksQueryLog.Cells.SpecialCells(xlLastCell).Column).Address(True, True, xlA1)
wksQueryLog.Range(strQueryLogRangeRef).Copy Destination:=QueryOutputWkSht.Range("A1")
Cheers