B
Bryan Kelly
I have been working on a macro to import a text file and make some changes
to prepare it for analysis. I have most of the changes working (pending
another question in this forum). I now need a method for the user to be able
to enter the file name to open. Preferable, they should be able to open some
type of browser window and select the file they want. Lacking that, at least
be able to type in the file name.
The book I have discusses building forms, but does not say how to get a form
into a macro and how to access the value of a variable. The first line of my
macro looks something like this:
Workbooks.OpenText FileName:= "C:\WORK\test.txt", Origin:= _
<snip>
I want to change this to something like:
<activate function to get file name>
filename = <what_ever_the_function_returned>
Workbooks.OpenText FileName:= _
"<value of filename>", Origin:= _
<snip>
How should this be done?
to prepare it for analysis. I have most of the changes working (pending
another question in this forum). I now need a method for the user to be able
to enter the file name to open. Preferable, they should be able to open some
type of browser window and select the file they want. Lacking that, at least
be able to type in the file name.
The book I have discusses building forms, but does not say how to get a form
into a macro and how to access the value of a variable. The first line of my
macro looks something like this:
Workbooks.OpenText FileName:= "C:\WORK\test.txt", Origin:= _
<snip>
I want to change this to something like:
<activate function to get file name>
filename = <what_ever_the_function_returned>
Workbooks.OpenText FileName:= _
"<value of filename>", Origin:= _
<snip>
How should this be done?