Skip to content

Latest commit

 

History

History
56 lines (34 loc) · 1.22 KB

Project.Application.ColumnBestFit.md

File metadata and controls

56 lines (34 loc) · 1.22 KB
title keywords f1_keywords ms.service api_name ms.assetid ms.date ms.localizationpriority
Application.ColumnBestFit method (Project)
vbapj.chm2037
vbapj.chm2037
project-server
Project.Application.ColumnBestFit
51f96761-33ab-d2e3-7a1e-c8266bdaa7a1
06/08/2017
medium

Application.ColumnBestFit method (Project)

Sets the width of a column to the width of its widest item.

Syntax

expression. ColumnBestFit( _Column_ )

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Column Optional Long A number that specifies the column to adjust. Columns are numbered from left to right, starting with 1. If Column is omitted, Project adjusts the width of the column that contains the active cell.

Return value

Boolean

Example

The following example adjusts the widths of the first five columns in the active table.

Sub BestFitFirstFiveCols() 
 
    Dim I As Integer ' Index used in For...Next loop. 
 
    For I = 1 To 5 
          ColumnBestFit Column:=I 
    Next I 
End Sub

[!includeSupport and feedback]