Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multiple File Select


i know u can use the following to pass a filename.

Code
-------------------

FName = Application.GetOpenFilename _
(filefilter:="Text Files(*.txt),*.txt,All Files (*.*),*.*"
-------------------

what i want to know can i have the user select multiple files at once
would FName just need to be an array or would i have to do it anothe
way

--
TheIrishThu
-----------------------------------------------------------------------
TheIrishThug's Profile: http://www.excelforum.com/member.php...fo&userid=2968
View this thread: http://www.excelforum.com/showthread.php?threadid=49571

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Multiple File Select

Hi irish,
To have select more tha n one file you should give
MultiSelect :=True
GetOpenFilename(FileFilter, FilterIndex, Title, ButtonText, MultiSelect)
and it will return an array of file names selected (even when a single file
is selected)

Thanks
Xcelion


"TheIrishThug" wrote:


i know u can use the following to pass a filename.

Code:
--------------------

FName = Application.GetOpenFilename _
(filefilter:="Text Files(*.txt),*.txt,All Files (*.*),*.*")
--------------------

what i want to know can i have the user select multiple files at once?
would FName just need to be an array or would i have to do it another
way?


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile: http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=495717


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Multiple File Select

Add an array declaration and Multiselect parameter to enable multiple
selections that fills the array with the selected files.....

Dim Fname()
Fname = Application.GetOpenFilename _
(filefilter:="Text Files(*.txt),*.txt,All Files (*.*),*.*",
MultiSelect:=True)




--
Cheers
Nigel



"TheIrishThug"
wrote in message
...

i know u can use the following to pass a filename.

Code:
--------------------

FName = Application.GetOpenFilename _
(filefilter:="Text Files(*.txt),*.txt,All Files (*.*),*.*")
--------------------

what i want to know can i have the user select multiple files at once?
would FName just need to be an array or would i have to do it another
way?


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile:

http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=495717



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Multiple File Select

Hi IrishThug,

Try something like:

'=============
Public Sub Tester001()
Dim FName As Variant
Dim i As Long

FName = Application.GetOpenFilename _
(filefilter:="Text Files(*.txt)," _
& "*.txt,All Files (*.*),*.*", _
MultiSelect:=True)

For i = LBound(FName) To UBound(FName)
Workbooks.Open FName(i)
Next

End Sub
'<<=============


---
Regards,
Norman




"TheIrishThug"
wrote in message
...

i know u can use the following to pass a filename.

Code:
--------------------

FName = Application.GetOpenFilename _
(filefilter:="Text Files(*.txt),*.txt,All Files (*.*),*.*")
--------------------

what i want to know can i have the user select multiple files at once?
would FName just need to be an array or would i have to do it another
way?


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile:
http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=495717



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multiple File Select


thanks guys, this is really helpfull.


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile: http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=495717



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
select multiple criteria multiple worksheets koneil Excel Worksheet Functions 1 December 12th 07 04:31 PM
open file dialog-select file-import worksheet Divinedar Excel Programming 1 January 16th 04 07:13 PM
Prompt user to select file with default file selected dialog Bruce Cooley Excel Programming 0 September 15th 03 06:43 AM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:22 PM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:19 PM


All times are GMT +1. The time now is 12:19 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"