+ Reply to Thread
Results 1 to 4 of 4

Macro to copy a cell to ANY pre-selected (non-adjacent) cells

  1. #1
    Registered User
    Join Date
    01-17-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, & 2010 Beta
    Posts
    78

    Macro to copy a cell to ANY pre-selected (non-adjacent) cells

    I'd like a macro to take a bunch of pre-selected cells - mostly non-adjacent to each other - and give them a range name, and then copy another (also range-named) cell to that range, and then delete that range name that was just given to those particular cells. My problem is (I record macros & try to edit as best I can) that, next time round, with a different selection of cells, the macro will assign the name to the earlier-selected cells, and not to the actual 'current' selection of cells. If someone could write me these few lines of code that I'm looking for, I'd be very grateful, thanks. Happy to clarify any aspect of this. Thanks.

    Lotusman

  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,693

    Re: Macro to copy a cell to ANY pre-selected (non-adjacent) cells

    Please show the code you have to start with.

    Why do you want to create a name range then immediately delete it?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,936

    Re: Macro to copy a cell to ANY pre-selected (non-adjacent) cells

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  4. #4
    Registered User
    Join Date
    01-17-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, & 2010 Beta
    Posts
    78

    Re: Macro to copy a cell to ANY pre-selected (non-adjacent) cells

    [SOLVED] Bernie, thanks very much! That worked. This is the sort of simple text I need to learn more of, that does not seem to get produced when recording macros . . . Appreciated.

    Lotusman
    Last edited by lotusman; 04-02-2021 at 04:05 PM. Reason: to mark SOLVED

+ 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. Copy values from adjacent cells to groups of adjacent cells with gaps
    By Kneigum in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2017, 04:50 PM
  2. Macro to copy non adjacent cells to external workbook and move down row
    By excitingexel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2016, 08:15 AM
  3. Replies: 3
    Last Post: 07-16-2014, 03:24 PM
  4. VBA Macro to copy & paste non-adjacent cells from one sheet to another
    By clo2peter in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-20-2014, 03:06 PM
  5. [SOLVED] Macro to copy selected cells contents to another cell
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-30-2013, 05:21 AM
  6. [SOLVED] Need MACRO to copy the text in the cell left of first selected cells (a column), paste all
    By joobeng in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-16-2013, 06:42 AM
  7. Macro to take selected cells times a selected cell
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2005, 08:05 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