Getting a list of filenames
do it this way then
Dim i as Long, j as Long
Dim FName As Variant
FName = Application.GetOpenFilename( _
"Excel files(*.XLS),*.XLS", Multiselect:=True)
If isarray(FName) Then
j = 0
for i = lbound(Fname) to ubound(FName)
Range("A1").Offset(j,0).Value = fName(i)
Next
Else
MsgBox "User cancelled"
End If
--
Regards,
Tom Ogilvy
"cottage6" wrote in message
...
Hi Tom, and thanks for the response. I'm getting a "type mismatch" error
on
"If FName < False Then". Can you help?
"Tom Ogilvy" wrote:
Dim i as Long, j as Long
Dim FName As Variant
FName = Application.GetOpenFilename( _
"Excel files(*.XLS),*.XLS", Multiselect:=True)
If FName < False Then
j = 0
for i = lbound(Fname) to ubound(FName)
Range("A1").Offset(j,0).Value = fName(i)
Next
Else
MsgBox "User cancelled"
End If
--
Regards,
Tom Ogilvy
"cottage6" wrote in message
...
Hello and HELP!
I'm using the following code to insert the selected filename into a
cell.
What I really need is for the user to be able to select multiple files
and
to
get those names into some sort of list so the user can select a file
from
that group. Is that possible? Remember when giving me a solution
that
I'm
not as slick as I could be creating code, so please include explicit
instructions! Thanks.
Dim FName As Variant
FName = Application.GetOpenFilename("Excel files(*.XLS),*.XLS")
If FName < False Then
Range("A1").Select
ActiveCell = FName
Else
MsgBox "User cancelled"
End If
|