double trouble
New Member
- Joined
- May 18, 2011
- Messages
- 4
Hello,
I am new to VBA and have a question for more experienced people. I have created a macro in VBA to open anohter excel file which is raw data in a not so pretty format, read certain data to an array, close the file, and put that data into a "pretty" formated sheet. Right now I have hard coded the file extension but would like to allow the user to select via a "browse" file screen which file to open. Is this possible?
I used the following command to open the file
Workbooks.Open "M:\SC Models\Short Circuit Study\Summer Bonin-Luke.xlsx" 'open summer case
and to close the file I use:
Workbooks("Summer Bonin-Luke.xlsx").Close SaveChanges:=False 'close workbook
I have looked in VBA help and in a couple of excel VBA books. I can find how to create dialog boxes and get user input, but cannot find if you can allow the user to browse through windows to select which file to open. Any light you can shine on this would be greatly appreciated.
Thank you.
I am new to VBA and have a question for more experienced people. I have created a macro in VBA to open anohter excel file which is raw data in a not so pretty format, read certain data to an array, close the file, and put that data into a "pretty" formated sheet. Right now I have hard coded the file extension but would like to allow the user to select via a "browse" file screen which file to open. Is this possible?
I used the following command to open the file
Workbooks.Open "M:\SC Models\Short Circuit Study\Summer Bonin-Luke.xlsx" 'open summer case
and to close the file I use:
Workbooks("Summer Bonin-Luke.xlsx").Close SaveChanges:=False 'close workbook
I have looked in VBA help and in a couple of excel VBA books. I can find how to create dialog boxes and get user input, but cannot find if you can allow the user to browse through windows to select which file to open. Any light you can shine on this would be greatly appreciated.
Thank you.