+ Reply to Thread
Results 1 to 11 of 11

Copy column from one sheet to another

  1. #1
    Registered User
    Join Date
    11-27-2012
    Location
    Fort Lupton, CO
    MS-Off Ver
    2010 on Windows 7
    Posts
    15

    Copy column from one sheet to another

    I want to copy a range of cells from one sheet to another using either an activeX or VBA control button. I'm stuck on the syntax for the pasting destination. Thanks for any help.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy column from one sheet to another

    Please post your code

  3. #3
    Registered User
    Join Date
    11-27-2012
    Location
    Fort Lupton, CO
    MS-Off Ver
    2010 on Windows 7
    Posts
    15

    Re: Copy column from one sheet to another

    Private Sub UPDATE1_Click()
    Range("N2:N389").Copy


    End Sub

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy column from one sheet to another

    Okay! this line
    Please Login or Register  to view this content.
    copies the range, but where exactly do you wish to paste these range? Do you also wish to just copy values only, or you do not care?

  5. #5
    Registered User
    Join Date
    11-27-2012
    Location
    Fort Lupton, CO
    MS-Off Ver
    2010 on Windows 7
    Posts
    15

    Re: Copy column from one sheet to another

    Yes, I want to copy values only. I want to copy to this range ("G2:G389") but it's on the first sheet and the range("N2:N389) is on the second sheet or rather the active sheet where the control lives.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy column from one sheet to another

    No problem

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-27-2012
    Location
    Fort Lupton, CO
    MS-Off Ver
    2010 on Windows 7
    Posts
    15

    Re: Copy column from one sheet to another

    That looks great but when I run it I get a Subscript out of Range runtime error.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy column from one sheet to another

    Well! I do not know what is the issue. I have tested it on the same data and same sheet name, it works. Could you please run the code and see in which line shows(you)-highlighted with yellow?

  9. #9
    Registered User
    Join Date
    11-27-2012
    Location
    Fort Lupton, CO
    MS-Off Ver
    2010 on Windows 7
    Posts
    15

    Re: Copy column from one sheet to another

    It is the first line, the one that copies the range

  10. #10
    Registered User
    Join Date
    11-27-2012
    Location
    Fort Lupton, CO
    MS-Off Ver
    2010 on Windows 7
    Posts
    15

    Re: Copy column from one sheet to another

    Ah, problem solved. Stupid me. My Sheets where not named sheet1 and sheet2. Fixed that and it works great!! Thanks so much for your help!

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy column from one sheet to another

    This one
    Please Login or Register  to view this content.
    could you make sure that the sheet name is the same as ("sheet2").No space, or spelling error?. You could copy the name as it by going to the sheet tab- Copy and paste the name.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1