Syntax

expression.AdjustColumnWidth

expression A variable that represents a QueryTable object.

Remarks

The maximum column width is two-thirds the width of the screen.

Example

This example turns off automatic column-width adjustment for the newly added query table on the first worksheet in the first workbook.

Visual Basic for Applications
With Workbooks(1).Worksheets(1).QueryTables _ .Add(Connection:= varDBConnStr, _ Destination:=Range("B1"), _ Sql:="Select Price From CurrentStocks " & _ "Where Symbol = 'MSFT'") .AdjustColumnWidth = False .Refresh End With

See also: