Microsoft Office Tutorials and References
In Depth Information
Importing and Formatting a Text File
Figure 39 – Text File in Excel
View the Appendix to learn how to store this procedure
in a Standard module.
Option Explicit¶
' * * * * *¶
Sub ImportTextFile()¶
'Variable declaration¶
Dim File As Variant¶
Dim i As Long¶
Dim Book As Workbook¶
'Ask for text files to open¶
File = Application.GetOpenFilename( _¶
FileFilter:="Text files (*.txt),*.txt", _¶
Title:="Select the files to import", MultiSelect:=True)¶
'Did the user cancel?¶
If TypeName(File) = "Boolean" Then Exit Sub¶
'Turn off screen updating¶
Application.ScreenUpdating = False¶
Search JabSto ::

Custom Search