Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

LoadText Method

Loads and parses the specified text file into a worksheet. The contents of the text file are loaded into the worksheet beginning at the specified cell. Existing cell contents will be overwritten.

expression.LoadText(File, Delimiters, ConsecutiveDelimAsOne, TextQualifier)

expression   An expression that returns a Range  object.

File   Required String. Specifies the name of the text file.

Delimiters   Optional String. Specifies the field delimiters.

ConsecutiveDelimAsOne   Optional Boolean. True to have consecutive delimiters considered as a single delimiter. The default value is False.

TextQualifier   Optional String. Specifies the text qualifier. The default value is the double quotation mark character.


This example inserts a tab-delimited text file into the active worksheet of Spreadsheet1. The contents of the text file will begin in cell B10.

Spreadsheet1.ActiveSheet.Range("B10").LoadText "tabfile.txt", Chr$(9)


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.