Shibatat,
I don't have a Mac, but this is how I do it for my PC.
Public FSO As New FileSystemObject
Sub Import_Text()
Dim WrdArray() As String
Dim txtstrm As TextStream
Dim line, FileName, sName As String
Dim clm As Long
Dim Rw As Long
FileName = InputBox("Enter the file name and file location", "Import File")
sName = InputBox("Enter Sheet Name", "Sheet Name Entry")
Sheets.Add.Name = sName
Sheets(sName).Select
Set txtstrm = FSO.OpenTextFile(FileName)
Rw = 2
Do Until txtstrm.AtEndOfStream
line = Replace(txtstrm.ReadLine, Chr(34), Chr(32))
clm = 1
WrdArray() = Split(line, ",")
For Each Wrd In WrdArray()
Word = Wrd
ActiveSheet.Cells(Rw, clm) = Wrd
clm = clm + 1
Next Wrd
Rw = Rw + 1
Loop
txtstrm.Close
MsgBox "Data Imported. " & Rw - 3 & " Records Found."
End Sub
Before accessing the text file you'll need to set up a reference enabling access to the file system. You do this by clicking the tools tab in the VBA code window and selecting the Microsoft Scripting Runtime library. Since you are using a Mac, maybe there is a Scripting Runtime libary for the Mac. I suspect that the code will not work, but maybe it is a start!
redsab
Bookmarks