jmpmolegraaf
New Member
- Joined
- Jul 10, 2013
- Messages
- 35
Hello all,
Thanks for helping me out with this one.
++
Dim wsCS As Worksheet
Dim wsCOMBI As Worksheet
Dim lastrowcs As Integer
Set wsCS = ThisWorkbook.Sheets("RAW-CS")
Set wsCOMBI = ThisWorkbook.Sheets("RAW-Combi")
lastrowcs = wsCS.Cells(Rows.Count, 1).End(xlUp).Row
wsCS.Range(Cells(2, 1), Cells(lastrowcs, 1)).Copy Destination:=wsCOMBI.Cells(2, 1)
++
I get a runtime error here (1004) on the last line but I have no idea why. It works with Range.Copy but I want a range that is set by using Cells().
Is there a difference in Copy from a normal range vs. Copy from a Cells() range?
I am facing this problem in a lot of situations and I want to avoid activating sheets manually (sheets.activate).
Thanks, best regards,
Jan-Martin
Thanks for helping me out with this one.
++
Dim wsCS As Worksheet
Dim wsCOMBI As Worksheet
Dim lastrowcs As Integer
Set wsCS = ThisWorkbook.Sheets("RAW-CS")
Set wsCOMBI = ThisWorkbook.Sheets("RAW-Combi")
lastrowcs = wsCS.Cells(Rows.Count, 1).End(xlUp).Row
wsCS.Range(Cells(2, 1), Cells(lastrowcs, 1)).Copy Destination:=wsCOMBI.Cells(2, 1)
++
I get a runtime error here (1004) on the last line but I have no idea why. It works with Range.Copy but I want a range that is set by using Cells().
Is there a difference in Copy from a normal range vs. Copy from a Cells() range?
I am facing this problem in a lot of situations and I want to avoid activating sheets manually (sheets.activate).
Thanks, best regards,
Jan-Martin