I am new to creating macros and would like to open many (100s) space delimited text files into Excel (Mac 2011). The following works for one file (123test.txt) but is there some way to open all .txt files within a specified folder (in this case "MRStexts") so I can do this in batches instead of one at a time? Thanks in advance!
Sub OpenMRStext()
'
' OpenMRStext Macro
' Open space delimited MRS text files
'
' Keyboard Shortcut: Option+Cmd+t
'
Workbooks.OpenText Filename:= _
"Macintosh HD:Users:ccc:Desktop:MRStexts:123test.txt" _
, Origin:=xlMacintosh, StartRow:=1, DataType:=xlDelimited, TextQualifier _
:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, Semicolon:=False _
, Comma:=False, Space:=True, Other:=False
End Sub
‹
Bookmarks