﻿# SetCol



**//XL, SetCol, \{colfirst=\}<##>, \{,collast=<##>\} \{,width=##\} \{,total|nototal\} \{,**[Common //XL Parameters](commonxlparameters.md)**\}**

Use SetCol to set attributes for a column or set of columns. Note that you have the option of referencing a previously defined format via the _formatid_=<formatid> parameter, in which case you should not specify any of the other font or format-related parameters. (A format includes a font.) Otherwise, you can specify any of the individual font and/or format parameters to effectively define the font and format on the fly. 

Note that if the _collast_ parameter is omitted, it is assumed to be the same as _colfirst_. If the first parameter is not named, it is assumed to be colfirst.

The SetCol directive(s) should be specified at the top of the file, before any data. 

In the case of a multi-sheet workbook, any SetCol directives apply only to current sheet, and are reset by the next AddSheet directive. In the case, new SetCol directives can appear after each AddSheet directives but before any data lines but before any subsequent data lines.

Parameter _total_ forces the column to be totaled, _nototal_ disables totals for the column. These override the ColTitleTextRegex directive in the CSV2XL.INI file, as well as the default rules, which are to total numeric columns.

**Examples**

//;Set column 3 to bold

//XL,SetCol,3,bold



//;Set columns 4-6 to have yellow background

//XL,SetCol,colfirst=4,collast=6,FILLPATTERN\_SOLID, patternfgc=COLOR\_YELLOW



//;Set column 7 to use predefined format name fmtspecial

//XL,SetCol,colfirst=7,formatid=fmtspecial



**History**

2019 September, A-Shell 6.5.1668, CSV2XL.SBX edit 234:  Parameters total | nototal added. 