Share via


QueryTable.TextFileTrailingMinusNumbers Property

Excel Developer Reference

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.

Visual Basic for Applications
  Sub CheckQueryTableSetting()
' Determine setting for TextFileTrailingMinusNumbers
If Range("A1").QueryTable.<strong class="bterm">TextFileTrailingMinusNumbers</strong> = True Then
    MsgBox "Numbers imported as text that begin with a '-' symbol " &amp; _
        "will be treated as a negative symbol."
Else
    MsgBox "Numbers imported as text that begin with a '-' symbol " &amp; _
        "will not be treated as a negative symbol."
End If

End Sub

See Also