Copy Columns From One Sheet To Another

  • I'm trying to copy several columns from one worksheet to another in the same workbook and I can't get even this simple example to work. Help!


    Code
    1. Private Sub CommandButton1_Click()
    2. Sheets("Sheet2").Select
    3. Columns("B:D").Select
    4. Selection.Copy
    5. Sheets("Sheet1").Select
    6. Range("C1").Select
    7. ActiveSheet.Paste
    8. Range("A1").Select
    9. End Sub


    I get a run time error 1004
    Select method of range class failed.

  • Re: Vba Copy Columns From One Sheet Of Workbook Onto Another Sheet


    Hi


    welcome to Ozgrid :)


    Code
    1. Private Sub CommandButton1_Click()
    2. Sheets("Sheet2").Columns("B:D").Copy Sheets("Sheet1").Range("C1")
    3. End Sub


    Wigi

    Regards,


    Wigi


    Excel MVP 2011-2014


    For more Excel memes: visit http://www.wimgielis.com ==> English articles ==> Excel memes


    -- Topics without [CODE] tags or a meaningful topic title, will be neglected by me (and probably many others as well) --

  • A userform can be used for column copying. The columns used in the sheet are listed on the userform's listbox as the headings . The selected columns are copied to other sheet.


    [Blocked Image: https://netmerkez.files.wordpress.com/2020/01/copy-columns.jpg]


    Details and example file