Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sea Sea is offline
external usenet poster
 
Posts: 3
Default Message box- Assign a file name to a variable, from user input

Hi,

I need a message box function that I can just call from any module. All I need it to do is ask the user for the filename they are using. Then when user, types in the filename & clicks ok, it assigns to a Global variable. I have the rest of the code out but I am struggling with this part. Doesnt matter about the path as all files are in the same dir.
Any help would be brill Thks Sea

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Message box- Assign a file name to a variable, from user input

Hi Sea

'type this at the top of the module
Public xyz As String

'this is the function
Function getxyz()
xyz = InputBox("What is the filename that you are using?")
End Function


Cheers
JulieD

"Sea" wrote in message
...
Hi,

I need a message box function that I can just call from any module. All I

need it to do is ask the user for the filename they are using. Then when
user, types in the filename & clicks ok, it assigns to a Global variable. I
have the rest of the code out but I am struggling with this part. Doesn't
matter about the path as all files are in the same dir.
Any help would be brill Thks Sea



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Message box- Assign a file name to a variable, from user input

fName = Application.GetOpenFileName()

This does not open the file, just provides the user with the file open
dialog to select a file.

It does return the name with the path, but you can strip off the path if you
need to.

--
Regards,
Tom Ogilvy


"Sea" wrote in message
...
Hi,

I need a message box function that I can just call from any module. All I

need it to do is ask the user for the filename they are using. Then when
user, types in the filename & clicks ok, it assigns to a Global variable. I
have the rest of the code out but I am struggling with this part. Doesn't
matter about the path as all files are in the same dir.
Any help would be brill Thks Sea



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
Can I request user in input variable value within formula? R Nelson Excel Worksheet Functions 11 June 3rd 08 01:29 PM
macro to save as a data input by user file name from a designated Brian Excel Discussion (Misc queries) 2 November 20th 07 04:00 AM
Opening a file with User Input [email protected] Excel Discussion (Misc queries) 3 March 28th 07 03:00 AM
How do I input a warning message to remind the user to enter into. sugarbrit17 Excel Discussion (Misc queries) 3 January 25th 05 08:31 PM
User Input File Name kem Excel Programming 2 July 14th 03 10:23 PM


All times are GMT +1. The time now is 09:03 PM.

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

About Us

"It's about Microsoft Excel"