Texas Longhorn
Active Member
- Joined
- Sep 30, 2003
- Messages
- 493
Hi all,
I'm a VBA newb, and I have the following code, which does not work:
I'm trying to copy a range on Sheet2, move over one column, paste the copied range in Sheet4, move over two column, repeat. My main issue (I think/hope) is that I don't understand how to reference the active cell in each sheet (this code is a one-off, so I start with my active cell in Sheet2 as A16, and my active cell in Sheet4 as B16).
Thanks for any help,
Bill
I'm a VBA newb, and I have the following code, which does not work:
Code:
Sub SheetToSheet()
For i = 1 To 367
With Sheet2
.Select
.Range(Selection, Selection.End(xlDonw)).Copy
.Cells.Offset(0, 1).Select
End With
With Sheet4
.Paste
Application.CutCopyMode = False
.Cells.Offset(0, 2).Select
End With
Next i
End Sub
I'm trying to copy a range on Sheet2, move over one column, paste the copied range in Sheet4, move over two column, repeat. My main issue (I think/hope) is that I don't understand how to reference the active cell in each sheet (this code is a one-off, so I start with my active cell in Sheet2 as A16, and my active cell in Sheet4 as B16).
Thanks for any help,
Bill