Search code examples
excelvbacopy-paste

Is there a way to copy multiple user selected cells into another worksheet all at the same time?


My main problem is copying a certain range of user selected data into another worksheet.

I tried using selection.copy but i think it is better to avoid using that function.

Is there a way that the user can select a single cell; copy the value of the cell including the values of the next three cells to its right, and paste it into a different worksheet?


Solution

  • To copy/paste everything (values, formatting, etc), use:

    ActiveCell.Resize(,3).Copy Destination:=Worksheets("myTargetWorksheetName").Range("A1")
    

    Just change “myTargetWorksheetName” to your actual destination sheet name and “A1” to your actual destination sheet landing cell

    To copy/paste values only:

    Worksheets("myTargetWorksheetName").Range("A1:C1").Value = ActiveCell.Resize(,3).Value