VBA to copy multiple offset cells

1.3k views Asked by At

This is probably basic but I can't find how to do it.

I want to select a cell and an offset cell 3 cells to the right. Not any in between. So if I selected A2, it would copy A2 and A5.

I've managed to do one or the other but can't work out how to combine. I am a beginner.

Thanks for the replies so far. Realise I worded my question wrong. I want to copy whichever cell is selected in column A and the corresponding cell on the same line in column E I have this so far but I can't work out how to get the code to do both at the same time

' Keyboard Shortcut: Ctrl+Shift+C
'
    ActiveCell.Copy
    ActiveCell.Offset(0, 5).Copy
End Sub
1

There are 1 answers

4
Nur Atiqah Hassan On
Sub Try()
Dim Selected_, Paste_ As Range
On Error Resume Next
'Allow user to select cell
Set Selected_ = Application.InputBox("Please select cell you would like to copy", Type:=8).Select
'Copy user's selected cell
Selection.Copy
'Offset, to select column E with the same row as user's selection
Set Paste_ = ActiveCell.Offset(0, 4).Select
'Paste value
ActiveCell.PasteSpecial
End Sub

This should help :)