Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I get the leftmost sheet name?

    I have a macro which takes and copies the active sheet to a new one in Excel. I would prefer to select the leftmost worksheet and copy that instead.

    Here is the line of code:

    Sheets(ActiveSheet.Name).Copy Before:=Sheets(ActiveSheet.Name)

    Can anyone help with the syntax?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: How do I get the leftmost sheet name?

    <pre>Sheets(1).Copy Before:=Sheets(1)</pre>


    Steve

  3. #3
    New Lounger
    Join Date
    Sep 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do I get the leftmost sheet name?

    Thanks, works a treat.

    Michael

Posting Permissions

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