+ Reply to Thread
Results 1 to 6 of 6

Select Worksheet via Box in VBA

  1. #1
    Registered User
    Join Date
    06-02-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    22

    Select Worksheet via Box in VBA

    Hello,

    I have an excel macro that opens the file open box. From there I can select whatever file I need and, based on which version of the macro I am using, it will then highlight the needed data. From there the code closes that workbook and paste the data into the initial master document. My question is, is there a way to have a box appear after the file open box that lets the user then select a worksheet inside that new document? I did not think my code was needed for this and I have tried several variations of the simple line-

    Please Login or Register  to view this content.
    So I am hoping there is a way to open a box that then shows the worksheets in the current workbook for the user to select.

    Is this even possible?

    Thank you for any help,
    Taya
    Last edited by taya; 06-08-2010 at 05:02 PM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Select Worksheet via Box in VBA

    You could maybe use the built in "More Sheets..." dialogue:

    Please Login or Register  to view this content.

    Hope it helps,

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Select Worksheet via Box in VBA

    If you want to use a UserForm which would give you more control of what happens once the user has selected a sheet this might be of use.

    Dom
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-02-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Select Worksheet via Box in VBA

    Thank you that is very helpful. I am working on integrating that into my code, which im not 100% sure on how to do. But I think I can make some progress.

    This is my code before your comment.

    [
    Thank you and if you have any more thoughts feel free to post them.

    Taya
    Last edited by taya; 06-08-2010 at 05:16 PM.

  5. #5
    Registered User
    Join Date
    06-02-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Select Worksheet via Box in VBA

    I imported the userform and inserted
    Please Login or Register  to view this content.
    into code. Worked perfectly.

    The only other change would be to put a box in for the user to select cells instead of having the static copy paste cells. I understand how to create the userform a bit more now but was not sure if this idea is viable and I should spend time programing it.

    Thanks for your help and input.

    Taya

  6. #6
    Registered User
    Join Date
    06-02-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Select Worksheet via Box in VBA

    I solved this issue by insering
    Please Login or Register  to view this content.
    into my code.

    Thanks for the help,

    Taya

+ 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