Selecting a range, and naming it, within a macro
Prep for a pre-employment Excel test with Job Test Prep
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Selecting a range, and naming it, within a macro

  1. #1
    Guest

    Default

     
    I have a macro which copies a column of data (variable length) to a certain part of a spreadsheet. I want to select the range and apply a name to it. When I use the Select Current Region option, it is recorded in the macro with the precise cell references, which is no use when running the macro for a list of a different length. Also, it cannot record the keystrokes of holding the tab down and pressing END.
    Can anyone help?
    Thanks, Andrew

  2. #2
    Guest

    Default

    Try recording the Ctrl-* combination. Alternatively, use the VBA code Activecell.CurrentRegion.Name="Any text"

    Marc

  3. #3
    Guest

    Default

      
    On 2002-03-15 01:52, Anonymous wrote:
    Try recording the Ctrl-* combination. Alternatively, use the VBA code Activecell.CurrentRegion.Name="Any text"

    Marc
    Hi Marc
    The VBA code worked beautifully. Many thanks.
    Incidentally, I didn't understand what you meant by "Try recording the Ctrl-* combination" - something about creating an outline?

    Many thanks again
    Andrew

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com