[RESOLVED] Worksheet error
Hi all,
I'm trying to copy data from Sheet2 in first workbook in to Sheet1 in second workbook.
But i encounter subscript error in my following code.
Code:
Sub CopyData()
Dim WS1 As Worksheet, WS2 As Worksheet
Set WS1 = Workbooks("A").Sheets("Name")
Set WS2 = Workbooks("B").Sheets("Name")
WS1.UsedRange.Copy WS2.Cells.(Rows.Count, "A").end(xlUp)
End Sub
How do i resolve this?
Is there any better ways to achieve this?
Please help and enlighten.
Re: [RESOLVED] Worksheet error
Managed to solve it. =X
Just noticed that my workbook is named as FinanceList.xls, so therefore i have to put as Workbooks("FinanceList.xls") instead of ("FinanceList").