+ Reply to Thread
Results 1 to 7 of 7

copy worksheet that is hidden and rename it using a userfom

  1. #1
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    copy worksheet that is hidden and rename it using a userfom

    Here
    http://www.excelforum.com/excel-prog...a-userfom.html
    I asked for a macro that copy an worksheet and rename it using a userfom!
    I received the xls file attached to this mail !
    In this xls when I click "Click me to copy s0 sheet and rename it" from final sheet, a userform appear, I type a name there and when I press ok I will have a copy of worksheet "s0" with the name typed in the userform.
    If I click on "Click me to copy s0 sheet and rename it" I can create as many copies as I need.

    But if I hide worksheet "s0" (using Format /Sheet/Hide) the macro will not work.
    I modified the code from module 1 adding the red code:
    Please Login or Register  to view this content.
    But using this code I can create only a copy of worksheet "s0" (worksheet "s0" is hidden, the new sheet is visible) .
    If I click on "Click me to copy s0 sheet and rename it" one more time I will have an error!
    Please help me to modify the code so I can create as many copy as I need for worksheet "s0" (I need sheet s0 to be hidden but the new sheets to be visible).
    Attached Files Attached Files
    Last edited by iscar_marius; 02-17-2009 at 03:34 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: copy worksheet that is hidden and rename it using a userfom

    You need to unhide the So sheet before creating the copy
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: copy worksheet that is hidden and rename it using a userfom

    But I need worksheet s0 to be hidden!
    It's not possible ?
    Last edited by iscar_marius; 02-16-2009 at 03:26 PM.

  4. #4
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: copy worksheet that is hidden and rename it using a userfom

    Quote Originally Posted by royUK View Post
    You need to unhide the So sheet before creating the copy
    I think I understand, I must unhide the sheet , create the copy and unhide the sheet again. I will this try tomorrow. Thanks!

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: copy worksheet that is hidden and rename it using a userfom

    You unhide it, copy it& then re-hide it.
    Attached Files Attached Files

  6. #6
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    Re: copy worksheet that is hidden and rename it using a userfom

    I had tried your variant but I had some error.
    I added the red code :
    Please Login or Register  to view this content.
    and it seems to work just fine!
    Thanks anyway for your time!

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: copy worksheet that is hidden and rename it using a userfom

    That's not the code that I added! My code is in the userform where it should be. See
    Please Login or Register  to view this content.
    The only thing that I would add is a check to see if the name exists, add this to a Standard Module
    Please Login or Register  to view this content.
    Amend the button code with this
    Please Login or Register  to view this content.

+ 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