Archive of Mr Excel Message Board
The function in lotus script is written like this...
Sub filepath
Dim filename As String,filepath As String,ext As String
ext=".txt"
filename$=filepath+filename+ext
[a:b2..a:s150].Rangecombinetext filename$
finished:
End Sub
So the main function call of this code is the "Rangecombinetext"
Is there a similar proceedure in excel ? and if so, would I be able to
pop up a file search box so the user can select the file to import ?
Many thanks in advance.
You can email me direct with any responses to mbrady@bigpond.net.au
Mark

Mark, I have sent a e-mail. I will post it her as well though:
Sub TryThis()
Dim Myfile As String
Myfile = Application.GetSaveAsFilename
If Myfile = "" Then Exit Sub
If Right(Myfile, 3) <> "txt" Then
MsgBox "Sorry, this is not a Text File!", vbCritical
Run "TryThis"
End If
End Sub
OzGrid Business Applications

Thanks Dave..but that sub actually saves a file (as in it saves the workbook) from what I can see.
I actually need to Import the entire contents of a text file into my named range in my workbook.
Mark

Dave
OzGrid Business Applications

Thanks Dave, That will open the file as a new sheet.
I still need to figure out how to not open the file but extract the text from it and place them into the range.
I'd like to be able to do this without the need to open a new sheet like I
can in 123. I'll keep hunting. Thanks for your time David.
Marko
