WksCellFormat Object

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

Properties

Alignment

Application

BackColor

DateFmtType

Digits

NumericType

Parent

Thousands

TimeFmtType

Method

Find

Replace

SetDateTimeFmtType

Example

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

Sub Main

 

 'Declares GrapherApp as an object

  Dim GrapherApp As Object

 

 'Creates an instance of the Grapher Application

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

  Set GrapherApp = CreateObject("Grapher.Application")

 

 'Makes Grapher visible

  GrapherApp.Visible = True

 

 'Declares Wks as an object

  Dim Wks As Object

 

 'Opens a worksheet document in Grapher and

 'assigns it to the variable named "Wks"

  Set Wks =GrapherApp.Documents.Open(GrapherApp.Path+"\Samples\bar chart orientations.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(1, 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