View Single Post
 
Old 08-26-2021, 12:28 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

There is probably a more elegant way but this appears to work
Code:
Sub CopyBeside()
  Dim aCell As Range
  For Each aCell In Selection
    aCell.Copy Destination:=aCell.Offset(0, 1)
  Next aCell
End Sub
And there we have another way courtesy of Purfleet - note there will likely be a difference with how a discontinuous selection works with these two alternative approaches.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia

Last edited by Guessed; 08-26-2021 at 12:31 AM. Reason: Purfleet's solution got there first
Reply With Quote