Closed Thread
Results 1 to 5 of 5

Copy a sheet and rename it

  1. #1
    quartz
    Guest

    Copy a sheet and rename it

    Can someone please show me what I am stupidly missing:

    I want to make a copy of a very hidden sheet named LogTemplate and position
    it after the sheet named LOG (visible). Rename the copy as Log Future # where
    # is the next number in sequence. So if Log Future 1 already exists, name the
    new one Log Future 2, and so on...

    I won't post my code (unless someone requests it) since it is useless any way.

    Thanks much in advance for your assistance.

  2. #2
    ben
    Guest

    RE: Copy a sheet and rename it

    try unhiding the sheet.
    copy it
    rename it
    then hide it again
    or is that what you are needing help with?

    "quartz" wrote:

    > Can someone please show me what I am stupidly missing:
    >
    > I want to make a copy of a very hidden sheet named LogTemplate and position
    > it after the sheet named LOG (visible). Rename the copy as Log Future # where
    > # is the next number in sequence. So if Log Future 1 already exists, name the
    > new one Log Future 2, and so on...
    >
    > I won't post my code (unless someone requests it) since it is useless any way.
    >
    > Thanks much in advance for your assistance.


  3. #3
    quartz
    Guest

    RE: Copy a sheet and rename it

    Really? I didn't think you needed to unhide the sheet to copy it...

    "ben" wrote:

    > try unhiding the sheet.
    > copy it
    > rename it
    > then hide it again
    > or is that what you are needing help with?
    >
    > "quartz" wrote:
    >
    > > Can someone please show me what I am stupidly missing:
    > >
    > > I want to make a copy of a very hidden sheet named LogTemplate and position
    > > it after the sheet named LOG (visible). Rename the copy as Log Future # where
    > > # is the next number in sequence. So if Log Future 1 already exists, name the
    > > new one Log Future 2, and so on...
    > >
    > > I won't post my code (unless someone requests it) since it is useless any way.
    > >
    > > Thanks much in advance for your assistance.


  4. #4
    quartz
    Guest

    RE: Copy a sheet and rename it

    You are right...it worked as you said. Thanks.

    "quartz" wrote:

    > Really? I didn't think you needed to unhide the sheet to copy it...
    >
    > "ben" wrote:
    >
    > > try unhiding the sheet.
    > > copy it
    > > rename it
    > > then hide it again
    > > or is that what you are needing help with?
    > >
    > > "quartz" wrote:
    > >
    > > > Can someone please show me what I am stupidly missing:
    > > >
    > > > I want to make a copy of a very hidden sheet named LogTemplate and position
    > > > it after the sheet named LOG (visible). Rename the copy as Log Future # where
    > > > # is the next number in sequence. So if Log Future 1 already exists, name the
    > > > new one Log Future 2, and so on...
    > > >
    > > > I won't post my code (unless someone requests it) since it is useless any way.
    > > >
    > > > Thanks much in advance for your assistance.


  5. #5
    Bob Phillips
    Guest

    Re: Copy a sheet and rename it

    Dim i As Long
    Dim sh As Worksheet

    i = 0
    On Error Resume Next
    Do
    Set sh = Nothing
    i = i + 1
    Set sh = Worksheets("Log Future " & i)
    Loop Until sh Is Nothing
    On Error GoTo 0

    Worksheets("Sheet2").Copy after:=Worksheets("Log")
    ActiveSheet.name = "Log Future " & i


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "quartz" <[email protected]> wrote in message
    news:[email protected]...
    > Can someone please show me what I am stupidly missing:
    >
    > I want to make a copy of a very hidden sheet named LogTemplate and

    position
    > it after the sheet named LOG (visible). Rename the copy as Log Future #

    where
    > # is the next number in sequence. So if Log Future 1 already exists, name

    the
    > new one Log Future 2, and so on...
    >
    > I won't post my code (unless someone requests it) since it is useless any

    way.
    >
    > Thanks much in advance for your assistance.




Closed 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