+ Reply to Thread
Results 1 to 3 of 3

Thread: assigning a name to the active cell for use in a macro

  1. #1
    Registered User
    Join Date
    12-03-2010
    Location
    Boston, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    assigning a name to the active cell for use in a macro

    Seems like it should be simple. Maybe it is.

    I want to copy a range to the current cell. I might be at A10. Later I might be at A23. Regardless, I want to be able to copy a named range to the current cell. I want to put this command in a macro, so that I don't have to go scrolling thru the sheet to find the range, copy it, go back to where I was and paste it.

    I have read about ActiveCell, but it doesn't seem as straightforward as it should be.

    Thanks,
    Geof Narlee

  2. #2
    Forum Guru mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2007/2010
    Posts
    3,004

    Re: assigning a name to the active cell for use in a macro

    Paste the following into a new module in the VBA editor (Alt F11)

    Sub PasteNamedRange()
    Range("MyNamedRange").Copy Destination:=Selection
    End Sub
    Edit to put in the actual name of your range. You might then want to assign a shortcut key to the macro (CNTRL something) for speed of use.
    Martin

    Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.

    If my solution has saved you time and/or money, please consider donating to Cancer Research UK.

  3. #3
    Registered User
    Join Date
    12-03-2010
    Location
    Boston, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: assigning a name to the active cell for use in a macro

    OMG. I've been trying to figure that one out, on & off, for years.

    THANK YOU SO MUCH, Martin.

    Just noticed your London Marathon Cancer Run. Will be back next week to enter a donation. Thanks again & good luck on the Marathon.
    Last edited by narlee; 12-03-2010 at 04:50 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0