+ Reply to Thread
Results 1 to 12 of 12

Copy selection, run-time error 1004 issue

  1. #1
    Registered User
    Join Date
    11-06-2014
    Location
    Austin, TX
    MS-Off Ver
    360
    Posts
    35

    Copy selection, run-time error 1004 issue

    Hey everyone, I'm hoping for some help with an issue I am having. What I am trying to do is copy multiple ranges not next to eachother and paste them into a different tab in the workbook. Here is the code that is having the issue:

    Please Login or Register  to view this content.

    When it gets to the Selection.Copy part it errors out as Run-Time error 1004 Command cannot be used on multiple selections. What I don't understand is I can use the record macro button, do the exact same copy and paste exercise in the same file without getting an error about the multiple selections. Does anyone know why I am getting this and if there is a way around it? Any help would be greatly appreciated, thanks!

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

    Re: Copy selection, run-time error 1004 issue

    Please Login or Register  to view this content.
    You left out the "

  3. #3
    Registered User
    Join Date
    11-06-2014
    Location
    Austin, TX
    MS-Off Ver
    360
    Posts
    35

    Re: Copy selection, run-time error 1004 issue

    Sorry yeah that was just left out when posting it on the forum. In the code it's there so not causing the issue here.

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

    Re: Copy selection, run-time error 1004 issue

    The error is in fact on this line (multi section is not allowed)

    Please Login or Register  to view this content.
    Could use similar line to this

    Please Login or Register  to view this content.
    Last edited by AB33; 03-18-2015 at 01:13 PM.

  5. #5
    Registered User
    Join Date
    11-06-2014
    Location
    Austin, TX
    MS-Off Ver
    360
    Posts
    35

    Re: Copy selection, run-time error 1004 issue

    When I use use your suggested code with ".Copy" I still get the same error message.

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

    Re: Copy selection, run-time error 1004 issue

    No, I have tested both lines and work. The error may be on the sheet name.

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy selection, run-time error 1004 issue

    Try:

    Changing this:

    Please Login or Register  to view this content.
    To this:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-06-2014
    Location
    Austin, TX
    MS-Off Ver
    360
    Posts
    35

    Re: Copy selection, run-time error 1004 issue

    Not sure what to tell you AB33, when I run it I still get the error. As for the sheet name, it doesn't have a problem selecting the tab and doing things in it, it's just when you try to copy so I don't know what you mean by the error being in the sheet name.

  9. #9
    Registered User
    Join Date
    11-06-2014
    Location
    Austin, TX
    MS-Off Ver
    360
    Posts
    35

    Re: Copy selection, run-time error 1004 issue

    Thanks for the reply John H. Davis, it errors out at the ".Copy" part and doesn't even get to the SETT sheet. I'm not sure if there is some external piece that is not allowing the ".Copy" or what. The tab is unlocked so is there something else that restricts that?

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

    Re: Copy selection, run-time error 1004 issue

    Please change this line
    Sheets(TABNM).
    INTO

    Sheets("sheet1") or another proper sheet name

    for testing and see if you get an error

  11. #11
    Registered User
    Join Date
    11-06-2014
    Location
    Austin, TX
    MS-Off Ver
    360
    Posts
    35

    Re: Copy selection, run-time error 1004 issue

    Thanks AB33, tried it but still getting the error. At this point I'm going to have to break them out individually into 4 copy and paste commands so this won't be an issue.

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

    Re: Copy selection, run-time error 1004 issue

    Please attach a sample and will be solved quickly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. “Selection.Insert Shift:=xlDown” gets Run-time error '1004'
    By watsonea4 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-02-2023, 07:07 AM
  2. Run Time Error 1004 and I can't Find the Issue
    By tracymickeyd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2013, 02:37 PM
  3. Copy and Pasting Issue (Runtime error '1004')
    By kinseld5 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2013, 08:26 AM
  4. Run Time Error 1004 - Selection too Large
    By sgedo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-01-2009, 10:47 PM
  5. [SOLVED] Macro Issue - Run time error 1004
    By Matt7102 in forum Excel General
    Replies: 1
    Last Post: 12-21-2005, 08:40 PM

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