QueryTable.TextFileTrailingMinusNumbers Property (Excel)
True for Microsoft Excel to treat numbers imported as text that begin with a "-" symbol as a negative symbol. False for Excel to treat numbers imported as text that begin with a "-" symbol as text. Read/write Boolean.
Syntax
expression .TextFileTrailingMinusNumbers
expression A variable that represents a QueryTable object.
Remarks
If you import data using the user interface, data from a Web query or a text query is imported as a QueryTable object, while all other external data is imported as a ListObject object.
If you import data using the object model, data from a Web query or a text query must be imported as a QueryTable, while all other external data can be imported as either a ListObject or a QueryTable.
The TextFileTrailingMinusNumbers property applies only to QueryTable objects.
Example
In this example, Microsoft Excel determines the setting for cell A1, treating numbers imported as text that begin with a "-" symbol. This example assumes a QueryTable object exists on the active worksheet.
Sub CheckQueryTableSetting()
' Determine setting for TextFileTrailingMinusNumbers
If Range("A1").QueryTable.TextFileTrailingMinusNumbers = True Then
MsgBox "Numbers imported as text that begin with a '-' symbol " & _
"will be treated as a negative symbol."
Else
MsgBox "Numbers imported as text that begin with a '-' symbol " & _
"will not be treated as a negative symbol."
End If
End Sub