RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 788
- Office Version
- 2010
- Platform
- Windows
For some reason I just have completely forgotten this. I'm trying to copy & paste on the same line to stop needing to activate sheets all the time.
Disgusting isn't it.
I want something that's more like
Pasting formats or not doesn't really matter. But when I try what I want, it gives some error message, can't remember exactly what it says but it's the typical generic "That's not right" and I can't figure it out, it looks like it should work. I have the Workbook defined as "wb" but when I do wb.cd.range it doesn't work.
Thanks.
VBA Code:
LastrowRep = Cells(Rows.Count, "B").End(xlUp).Row
Range("A7:A" & LastrowRep).Copy
cd.Activate
cd.Range("A" & Lastrow + 1).PasteSpecial xlPasteValuesAndNumberFormats
pg1.Activate
Range("C7:C" & LastrowRep).Copy
cd.Activate
cd.Range("B" & Lastrow + 1).PasteSpecial xlPasteValuesAndNumberFormats
pg1.Activate
Range("F7:F" & LastrowRep).Copy
cd.Activate
cd.Range("C" & Lastrow + 1).PasteSpecial xlPasteValuesAndNumberFormats
pg1.Activate
Range("S7:S" & LastrowRep).Copy
cd.Activate
cd.Range("D" & Lastrow + 1).PasteSpecial xlPasteValuesAndNumberFormats
Disgusting isn't it.
I want something that's more like
VBA Code:
Range("S7:S" & LastrowRep).Copy (cd.range("D" & Lastrow + 1)
Pasting formats or not doesn't really matter. But when I try what I want, it gives some error message, can't remember exactly what it says but it's the typical generic "That's not right" and I can't figure it out, it looks like it should work. I have the Workbook defined as "wb" but when I do wb.cd.range it doesn't work.
Thanks.