#1   Report Post  
Posted to microsoft.public.excel.programming
MWS MWS is offline
external usenet poster
 
Posts: 53
Default Input Box

I have written a macro to retrieve a specific text file from our network and
import it into excel and perform several functions. The scenario has changed
so now the users need to select from several network files, so to
systematically "point" to the one file no longer meets the need. So, can
anyone tell me how to utilize an inputbox, with hopefully some sort of
elipse, so the user can begin the macro to display the input box, via an
elipse, locate/point to the text file and then inport the file via the valued
input box? (it's the input box part I really need help with, since the code
already exist to import and sort the text file data).

Any and all help will be greatly appreciated. Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Input Box

fname = Application.GetOpenFileName()

Will display the file=Open dialog and allow the user to navigate and select
a file. The fully qualified name of the file (name and path) are returned
to the variable fname (as shown above - the file is not opened) and you can
use that variable to pass the name to the code that does open and process
the file.

See help on GetOpenFileName for additional arguments and options.

If you want to start in a specific directory, before showing the dialog, use
chdrive and chdir to make the start directory the default.

--
Regards,
Tom Ogilvy


"MWS" wrote in message
...
I have written a macro to retrieve a specific text file from our network

and
import it into excel and perform several functions. The scenario has

changed
so now the users need to select from several network files, so to
systematically "point" to the one file no longer meets the need. So, can
anyone tell me how to utilize an inputbox, with hopefully some sort of
elipse, so the user can begin the macro to display the input box, via an
elipse, locate/point to the text file and then inport the file via the

valued
input box? (it's the input box part I really need help with, since the

code
already exist to import and sort the text file data).

Any and all help will be greatly appreciated. Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
MWS MWS is offline
external usenet poster
 
Posts: 53
Default Input Box

Thank You Tom - I will try your suggestion.

"Tom Ogilvy" wrote:

fname = Application.GetOpenFileName()

Will display the file=Open dialog and allow the user to navigate and select
a file. The fully qualified name of the file (name and path) are returned
to the variable fname (as shown above - the file is not opened) and you can
use that variable to pass the name to the code that does open and process
the file.

See help on GetOpenFileName for additional arguments and options.

If you want to start in a specific directory, before showing the dialog, use
chdrive and chdir to make the start directory the default.

--
Regards,
Tom Ogilvy


"MWS" wrote in message
...
I have written a macro to retrieve a specific text file from our network

and
import it into excel and perform several functions. The scenario has

changed
so now the users need to select from several network files, so to
systematically "point" to the one file no longer meets the need. So, can
anyone tell me how to utilize an inputbox, with hopefully some sort of
elipse, so the user can begin the macro to display the input box, via an
elipse, locate/point to the text file and then inport the file via the

valued
input box? (it's the input box part I really need help with, since the

code
already exist to import and sort the text file data).

Any and all help will be greatly appreciated. Thanks in advance.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 04:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"