+ Reply to Thread
Results 1 to 3 of 3

recognize a sheet

  1. #1
    Registered User
    Join Date
    12-29-2004
    Posts
    37

    recognize a sheet

    I want to make a copy of the 1st sheet and then rename it.
    the name of the sheet is always changing, anyway I can get
    VB to select the sheet no matter what it's name is?

    Sheets("sheet-x").Copy After:=Sheets(1)
    Sheets("sheet-x (2)").Select
    Sheets("sheet-x (2)").name = "sheet-y"

  2. #2
    Bob Phillips
    Guest

    Re: recognize a sheet

    Either use its index

    Sheets(1).Copy After:=Sheets(1)

    or its codename

    Sheet1.Copy After:=Sheets(1)



    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "zerosleep" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I want to make a copy of the 1st sheet and then rename it.
    > the name of the sheet is always changing, anyway I can get
    > VB to select the sheet no matter what it's name is?
    >
    > Sheets("sheet-x").Copy After:=Sheets(1)
    > Sheets("sheet-x (2)").Select
    > Sheets("sheet-x (2)").name = "sheet-y"
    >
    >
    > --
    > zerosleep
    > ------------------------------------------------------------------------
    > zerosleep's Profile:

    http://www.excelforum.com/member.php...o&userid=17846
    > View this thread: http://www.excelforum.com/showthread...hreadid=518695
    >




  3. #3
    Registered User
    Join Date
    12-29-2004
    Posts
    37

    Talking ya ha!

    beautiful!!!

    thank you bob, I guess it was so simple I didn't even think of it.
    all this time I would just change the sheet name to reflect the
    macros...much easier now.

    -zerosleep

+ 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.6.0 RC 1