Ashnfreeman
New Member
- Joined
- Mar 8, 2019
- Messages
- 1
Hello! I have a line of code
Range("A1:LastTableCell").Copy Worksheets("PasteSheet").Range("PasteToHere").Value
This keeps giving me an error, and I'm guessing it's because I'm using variables. LastTableCell and PasteToHere are both variables that contain addresses. For example, LastTableCell holds $C$5 and PasteToHere holds $E$1.
I'm very new to VBA, so I'm not sure if this is even possible, but how do I copy the range of cells from A1 to the address stored in LastTableCell and paste to the address contained in PasteToHere? Thanks so much in advance and apologies if this has been answered before, I keep googling but all I get is how to copy regular ranges.
Range("A1:LastTableCell").Copy Worksheets("PasteSheet").Range("PasteToHere").Value
This keeps giving me an error, and I'm guessing it's because I'm using variables. LastTableCell and PasteToHere are both variables that contain addresses. For example, LastTableCell holds $C$5 and PasteToHere holds $E$1.
I'm very new to VBA, so I'm not sure if this is even possible, but how do I copy the range of cells from A1 to the address stored in LastTableCell and paste to the address contained in PasteToHere? Thanks so much in advance and apologies if this has been answered before, I keep googling but all I get is how to copy regular ranges.