WksCellFormat Object

 

The WksCellFormat object contains the properties of one or more worksheet cells such as the numeric format and the alignment.

 

Properties

Alignment

Application

BackColor

Digits

NumericType

Parent

Thousands

 

Methods

SetDateTimeFmtType

 

Example

The following script demonstrates how the WksCellFormat object is used in reference to the WksRange object.

 

Sub Main

'Declares mvApp as an object

 Dim mvApp As Object

 

'Creates an instance of the MapViewer Application

'object and assigns it to the variable named "mvApp"

 Set mvApp = CreateObject("MapViewer.Application")

 

'Makes MapViewer visible

 mvApp.Visible = True

 

'Declares Wks as an object

 Dim Wks As Object

 

'Opens a worksheet document in MapViewer and

'assigns it to the variable named "Wks"

 Set Wks = mvApp.Documents.Open(FileName:=mvApp.ApplicationFolder + _

 "\Samples\co2010.dat")

 

'Declares WksRange as an object

 Dim WksRange As Object

 

'Assigns Columns A, B, and C to the

'variable named "WksRange"

 Set WksRange = Wks.Columns(Col1:=1, Col2:=3)

 

'Declares WksCellFormat as an object

 Dim WksCellFormat As Object

 

'Assigns the cell format of the range to

'the variable named "WksCellFormat"

 Set WksCellFormat = WksRange.Format

End Sub