8.1.26.18 Worksheet::SetColFormats

It is recommended that you switch to the originpro package. PyOrigin is primarily for users who need to work with Origin version prior to 2021.

Description

Sets the column formats in a worksheet.

Syntax

SetColFormats(Formats, Repeat = True)

Parameters

Formats
String containing packed numbers indicating column Format for all columns in worksheet
Repeat
Repeat entire pattern over remaining columns (True) or set designations for the rest of columns to be the last one defined by pattern (False) default is True.
0: Numeric
1: Text
2: Time
3: Date
4: Month
5: Day of Week
9: Text and Numeric

Return

Returns True on successful and False on failure.

Examples

#Create Sheet in Book1 with 5 columns

#the following code will set column formats in a new worksheet
# 1st column - Numeric (0)
# 2nd column - Text    (1)
# 3rd column - Time    (2)
# 4th column - Date    (3)
# 5th column - Text and Numeric (9)
wks=PyOrigin.WorksheetPages('Book1').Layers(0)
Formats="01239"
wks.SetColFormats(Formats)

See Also

Worksheet::GetColFormats