Select or Copy three 3 non-adjacent cells
Asked Answered
R

4

6

How can I copy 3 non-adjacent cells using ActiveCell.Row?

Range("A" & ActiveCell.Row, "C" & ActiveCell.Row, "E" & ActiveCell.Row).Copy

Update: For further info follow - https://youtu.be/zjF7oLLgtms

Raffinate answered 24/9, 2019 at 7:45 Comment(0)
J
9

To simplify things a little:

Range(Replace("A?,C?,E?", "?", ActiveCell.Row)).Copy
Jahvist answered 24/9, 2019 at 8:26 Comment(0)
M
5

You have the , outside the "". You need to put them inside. See this

Range("A" & ActiveCell.Row & ",C" & ActiveCell.Row & ",E" & ActiveCell.Row).Copy
Marlysmarmaduke answered 24/9, 2019 at 8:14 Comment(0)
D
3

Try this:

Union(Cells(ActiveCell.Row, 1), Cells(ActiveCell.Row, 3), Cells(ActiveCell.Row, 5)).Copy
Damnatory answered 24/9, 2019 at 7:51 Comment(0)
D
2

I think there is tons of way to do this, you might read this it will give you better insight.

I would have done :

Sub test()

Set x = Application.Union(Range("A" & ActiveCell.Row), Range("C" & ActiveCell.Row), Range("E" & ActiveCell.Row))
x.Copy

End Sub
Dorcasdorcea answered 24/9, 2019 at 8:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.