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
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
To simplify things a little:
Range(Replace("A?,C?,E?", "?", ActiveCell.Row)).Copy
You have the ,
outside the ""
. You need to put them inside. See this
Range("A" & ActiveCell.Row & ",C" & ActiveCell.Row & ",E" & ActiveCell.Row).Copy
Try this:
Union(Cells(ActiveCell.Row, 1), Cells(ActiveCell.Row, 3), Cells(ActiveCell.Row, 5)).Copy
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
© 2022 - 2024 — McMap. All rights reserved.