+ Reply to Thread
Results 1 to 6 of 6

Excel VBA 2010 - Copy to WB, RTE 1004 - That command cannot be used on multiple selections

  1. #1
    Registered User
    Join Date
    09-07-2014
    Location
    Denmark
    MS-Off Ver
    2010
    Posts
    5

    Excel VBA 2010 - Copy to WB, RTE 1004 - That command cannot be used on multiple selections

    Dear all,

    I have an issue in my Code.
    Sometimes it runs without issues, and sometimes not. I have not found the system.

    I want to copy a named area in a sheet in current wb (XLSM) to a new workbook. As default, new wb's are xlsx.
    I have read somewhere, that this error can occur, if the new wb is xls. But that is not the case.

    In the worksheet there are som hidden columns, but these are not part if the named area.

    When an issue occurs, it is the same place. Please see the red line below.


    Please Login or Register  to view this content.
    I hope you can shed som light over this issue - what am I doing wrong, and most exciting, why is this not a consequence error. Sometimes it works, sometimes not.

    wbr
    Benjamin
    Last edited by Sleever; 09-07-2014 at 01:50 PM. Reason: Adding [CODE] as requested

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Excel VBA 2010 - Copy to WB, RTE 1004 - That command cannot be used on multiple select

    Hi, Sleever,

    please have a read at Forum Rule #3 and add code-tags to your procedure as explained there.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    09-07-2014
    Location
    Denmark
    MS-Off Ver
    2010
    Posts
    5

    Re: Excel VBA 2010 - Copy to WB, RTE 1004 - That command cannot be used on multiple select

    Hi Holger,

    Dont see the issue wrt. #3 - very easy to replicate code.
    Easy so select code, and to paste directly into module for testing - if wanted.

    I respect "dresscode", but this seems a little off...


    - Sleever

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Excel VBA 2010 - Copy to WB, RTE 1004 - That command cannot be used on multiple select

    Even easier to add code tags which make the code easier to read and to copy/paste.

    Anyway, does this work?

    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    09-07-2014
    Location
    Denmark
    MS-Off Ver
    2010
    Posts
    5

    Re: Excel VBA 2010 - Copy to WB, RTE 1004 - That command cannot be used on multiple select

    Hi Holger,

    I appologize for my novice answer. I have now read and understood #3 - and have corrected the mistake.
    Thanks for letting me know. I was defensive, because I have seen before on other forums how some people find it more interesting to put rules on others, than actually doing what the forum is all about.


    Hope you accept,

    wbr
    Ben

  6. #6
    Registered User
    Join Date
    09-07-2014
    Location
    Denmark
    MS-Off Ver
    2010
    Posts
    5

    Re: Excel VBA 2010 - Copy to WB, RTE 1004 - That command cannot be used on multiple select

    Hi Norie,

    yes - you are right. I have appologized to Holger.
    I have tried your code. I get error her;

    Please Login or Register  to view this content.
    Excel error: Run-time errot '1004':
    PasteSpecial method of Range class failed.


    wbr
    Ben
    Last edited by Sleever; 09-07-2014 at 02:11 PM. Reason: Updating Excel erro

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Excel VBA 2010 - Copy to WB, RTE 1004 - That command cannot be used on multiple select

    Hi, Ben,

    you should try and work with objects throughout (I know: easy to tell and hard to do).

    Maybe try
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.
    Ciao,
    Holger

+ 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. Replies: 4
    Last Post: 10-21-2013, 02:55 PM
  2. Copy and paste for multiple selections
    By amartino44 in forum Excel General
    Replies: 3
    Last Post: 07-12-2013, 02:34 PM
  3. Replies: 3
    Last Post: 05-16-2013, 06:08 AM
  4. Copy multiple selections in excel 2003
    By John Musbach in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2009, 09:08 PM
  5. [SOLVED] I cannot do the oopy paste command in multiple selections in the .
    By Penny in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2005, 12:05 PM

Tags for this Thread

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