+ Reply to Thread
Results 1 to 11 of 11

Help required with Run-Time Error 1004 - This action won't work with multiple selections

  1. #1
    Registered User
    Join Date
    11-09-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    7

    Help required with Run-Time Error 1004 - This action won't work with multiple selections

    Hi all,

    Apologies in advance if there are already multiple threads on this but I've literally just jumped on here as I'm a bit "up-against-time"

    I'm a massive VBA novice yet still the most experienced VBA user in the office (go figure), looking for a little help with Run-Time-Error 1004 - This action won't work with multiple selections.

    I'm currently running the following code using 2 control buttons, simply so I can test functionality before moving on:

    Please Login or Register  to view this content.
    The first section, Sub FindAll1, works fine with the first control button, however, the second section, Sub FindAll2, hits a Run-Time Error 1004 - This action won't work on multiple actions when it reach Rng2.EntireRow.Copy

    Any ideas what I'm doing wrong?

    Thanks, in advance

    UPDATE: Correction to my original post as per request from Mehmetcik (apologies again)
    Last edited by Silvah; 11-10-2021 at 05:54 AM. Reason: Correction to original post to add tags

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help required with Run-Time Error 1004 - This action won't work with multiple selectio

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    11-09-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    7
    Many thanks Mehmetcik and apologies for my poor forum etiquette.

    Please see code below in appropriate tags, any and all help is very greatly appreciated.

    Regards,
    Silvah

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help required with Run-Time Error 1004 - This action won't work with multiple selectio

    Thanks for trying.

    However you need to edit the Original post for me.

    The good news is I spent some time on this and have an answer for you.

  5. #5
    Registered User
    Join Date
    11-09-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    7

    Re: Help required with Run-Time Error 1004 - This action won't work with multiple selectio

    Quote Originally Posted by mehmetcik View Post
    Thanks for trying.

    However you need to edit the Original post for me.
    Original post edited (my apologies once again)

    Quote Originally Posted by mehmetcik View Post
    The good news is I spent some time on this and have an answer for you.
    Many thanks for taking a look at this Mehmetcik, very greatly appreciated

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help required with Run-Time Error 1004 - This action won't work with multiple selectio

    Hi

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-09-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    7

    Re: Help required with Run-Time Error 1004 - This action won't work with multiple selectio

    Thanks Mehmetcik, very much appreciated. I'll give this a look and let you know

  8. #8
    Registered User
    Join Date
    11-09-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    7

    Re: Help required with Run-Time Error 1004 - This action won't work with multiple selectio

    Hi Mehmetcik,

    That worked great as your standalone file, however, when I applied the code to my file (sample of hopefully attached) I get the same runtime error as before, even if the split the code for Rng1 and Rng2 across 2 different modules (just in case). I've also removed the buttons from my file for the time being as I was starting to get overly hung up about whether they were problem or not (lack of caffeine plus fried brain = clutching-at-straws-syndrome)
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help required with Run-Time Error 1004 - This action won't work with multiple selectio

    The good news I have found the Error.

    Bad News. You cannot use the entirerow function. as it is.

    You are selecting B12 and c12 and then entirerow twice.......

    Let me get back to you with a solution.

    Just the first and last lines of code in the segment below need changing.

    Don't join the cell to Rng2 using Union. Instead join the cell in column A of the cell to Rng2 using Union

    Eg
    Please Login or Register  to view this content.
    ====> A1 so no Issue

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by mehmetcik; 11-10-2021 at 09:24 AM.

  10. #10
    Registered User
    Join Date
    11-09-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    7

    Re: Help required with Run-Time Error 1004 - This action won't work with multiple selectio

    Thanks Mehmetcik, I had a feeling I was doing something daft but couldn't put my finger on what it was as everything worked for the Rng1 selection....

  11. #11
    Registered User
    Join Date
    11-09-2021
    Location
    UK
    MS-Off Ver
    365
    Posts
    7

    Re: Help required with Run-Time Error 1004 - This action won't work with multiple selectio

    Brilliant, thank you very much indeed Mehmetcik. Interestingly, once you highlighted what I was wanting my code to do and what it was actually doing at the time, I went back and revisited the original worksheet (and the sample one I posted) and found the culprit causing the issue which you pointed out as being cells B12 and C12 in the sample worksheet I posted. Unfortunately, this is just 1 of a number of workbooks that people other than myself have access to for recording info and I didn't once account for the possibility that someone else might put a typo in any one of the cells (in this case the offender in B12 should have been 5D7815)

    Thank you once again for your valuable help

+ 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. excel vba runtime error 1004 "this action won't work on multiple selections"
    By aprildu in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-08-2023, 04:17 PM
  2. Replies: 2
    Last Post: 12-18-2019, 07:13 PM
  3. [SOLVED] Run Time Error 1004-works in one system without any error but in another does not work
    By paradise2sr in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 05-25-2019, 09:47 PM
  4. Run-time error 1004: this action won't work on multiple selections
    By aprildu in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-08-2018, 12:50 PM
  5. Work book not found. Run time error 1004
    By ictfc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2015, 09:16 AM
  6. [SOLVED] Work around for Run-time Error 445: Object Doesn't Support This Action (File Search)
    By JPDutch in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-05-2013, 08:48 AM
  7. Macros stop to work when work sheet is protected. Run time error 1004
    By sellim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2012, 01:14 AM

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