+ Reply to Thread
Results 1 to 8 of 8

Workbook macro telling me doesn't work on multiple selections

  1. #1
    Registered User
    Join Date
    04-23-2022
    Location
    london
    MS-Off Ver
    office365
    Posts
    90

    Workbook macro telling me doesn't work on multiple selections

    Hi

    I have this macro but it tells me that it dont work on mutliple selections. How can I get round that?

    HTML Code: 

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Workbook macro telling me doesn't work on multiple selections

    You can't do that manually on a worksheet, either. You cannot copy non-contiguous cells from both multiple rows and multiple columns. I'm not talking about the Paste--you cannot even do the Copy.

    You are copying many non-contiguous cells to a single target cell. What kind of result do you want to get? You will have to rewrite this to do one copy for the column C cells and another copy one for the column E cells.

    One option:
    Please Login or Register  to view this content.
    This will give all values contiguously in a single column starting at Cells(lngEmptyRow, lngEmptyCol).
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Workbook macro telling me doesn't work on multiple selections

    Or something like this maybe?
    Please Login or Register  to view this content.
    Experience trumps academics every day of the week and twice on Sunday.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Workbook macro telling me doesn't work on multiple selections

    What is this giving you?
    Please Login or Register  to view this content.
    Your "lngEmptyRow" and "lngEmptyColumn" has me stumped (easy to do)
    Where do you want to paste the result?
    Last edited by jolivanes; 06-26-2022 at 03:58 PM.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Workbook macro telling me doesn't work on multiple selections

    Taking a wild stab at it. Don't know if the lc and lr are right.
    Try it on a copy of your original.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-23-2022
    Location
    london
    MS-Off Ver
    office365
    Posts
    90

    Re: Workbook macro telling me doesn't work on multiple selections

    comes up with type mismatch here

    ReDim Preserve celArr(1 To UBound(celArr), 1 To 2)

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Workbook macro telling me doesn't work on multiple selections

    Did you try the solution in post #2?

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Workbook macro telling me doesn't work on multiple selections

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until you provide a link or, for members with fewer than 10 posts, a comment telling us where else you have posted this query.)

+ 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. Macro doesn't work with shared workbook
    By maranto in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-20-2021, 06:00 AM
  2. Replies: 1
    Last Post: 01-29-2016, 06:15 AM
  3. [SOLVED] Macro doesn't work with another workbook acitive
    By kioolt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-24-2014, 12:17 AM
  4. [SOLVED] Macro work in personal workbook, doesn't work in other workbooks
    By Centexcel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-30-2013, 11:47 AM
  5. macro to copy cells to a new workbook doesn't work properly
    By dileva in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2013, 10:55 AM
  6. [SOLVED] Macro doesn't work when workbook is renamed
    By tandi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2012, 01:13 PM
  7. Macro that should create csvs of all the sheets of a workbook doesn't work! help!
    By scantron in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-15-2012, 12:46 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