Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Aug 2001
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Browse for file? (2001)

    Hello all! I want to make a program that consolidates data from a number of different sheets. How would I go about making it so the user can click a button and a "Browse" window would pop up, wherin the user the could browse for the file (simple Excel sheet), click it, and have the data imported, opened, or added as a sheet to the current workbook? Thanks. You guys have helped me so much in learning Excel/VB coding.

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Browse for file? (2001)

    Kevin

    This is a whole project. I will give you some pointers and then you can try and follow through.

    To find a workbook/file try using the Built in Open dialog. The advantage is that people know what to do with it, and it will open the workbook for you.

    Try: Application.Dialogs(xlDialogOpen).Show

    You can also change the Path prior to showing the open dialog to limit the user from searching all over the network. Try something like:
    ChDrive "C"
    ChDir "C:New Folder"

    To copy/Move a worksheet from the Opened workbook you can try something like:

    Sheets("Sheet1").Move After:=Workbooks("MyWorkbook.xls").Sheets(6).

    Surely this can be made more elegant, but try to get started, and if you need any help please ask again.

    Good Luck

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    Star Lounger
    Join Date
    Aug 2001
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Browse for file? (2001)

    Wassim,

    Thanks for the reply. This is what I need, nothing too fancy. I plan on using your idea of using the builtin open dialog, and then copying/moving the new ActiveSheet into my own sheet. Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •