+ Reply to Thread
Results 1 to 6 of 6

Select a Sheet you don't know the name of yet?

  1. #1
    Forum Contributor
    Join Date
    10-01-2008
    Location
    Eureka, CA
    Posts
    161

    Select a Sheet you don't know the name of yet?

    I have a macro that duplicates a hidden page, and names the duplicate sheet by cell reference. then the macro goes back and resets the forms that were used, what i would like to do is have it end selected on the newly created sheet, but i can't reference the sheet because i don't know in advance what the sheets name will be. does anyone have any idea how to select a sheet that you don't know the name of? Thanks in advance guys
    Last edited by humboldtguy; 08-08-2009 at 03:07 PM. Reason: Question Answered

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Select a Sheet you don't know the name of yet?

    What you want can be done
    As to the best method it will depend a lot on your existing code

    Are you wanting to select the sheet before or after it has been renamed/created

    Please post your code or preferably a copy of the workbook
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Contributor
    Join Date
    10-01-2008
    Location
    Eureka, CA
    Posts
    161

    Re: Select a Sheet you don't know the name of yet?

    Quote Originally Posted by mudraker View Post
    What you want can be done
    As to the best method it will depend a lot on your existing code

    Are you wanting to select the sheet before or after it has been renamed/created

    Please post your code or preferably a copy of the workbook
    Here is my code, the workbook has a lot of other peoples personal info in it at the moment....i can make a dummy if you need me to...but basically the last thing i want to do in this macro is select the newly created sheet so that the end user will hit the button and be taken exactly where he needs to be next, if that makes sense...thanks for the quick response
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Select a Sheet you don't know the name of yet?

    Based on your code I beleive the easisest method is to use a variable

    Added/changed code showing in Red

    Your code can also be improved by as you do not always need to select cells to copy them - see more code posted after your macro

    Please Login or Register  to view this content.

    The following code is from the 1st part of your macro with most of the selection replaced.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-01-2008
    Location
    Eureka, CA
    Posts
    161

    Re: Select a Sheet you don't know the name of yet?

    Mudraker, that is perfect...thank you so much, this forum is terrific, I can't thank you guys enough for all the help, my workbook does things I never imagined possible when I started it about 3 weeks ago...thanks again

    Quote Originally Posted by mudraker View Post
    Based on your code I beleive the easisest method is to use a variable

    Added/changed code showing in Red

    Your code can also be improved by as you do not always need to select cells to copy them - see more code posted after your macro

    Please Login or Register  to view this content.

    The following code is from the 1st part of your macro with most of the selection replaced.

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Select a Sheet you don't know the name of yet?

    Thanks for the feed back

    For Your Info
    Whilst the following is not a forum rule it is considered bad posting to include all of a previous message as a quote when replying

    If you do need to quote from previous posts then only include the section that is relevant to the message you are currently entering

+ 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