![]() |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 05:33 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com