WksRange Object

 

The WksRange object represents one or more cells within a worksheet. Methods exist to copy the cells, change cell properties, sort columns, and calculate column statistics.

 

Properties

Application

Column

ColumnCount

ColumnWidth

Count

EntireColumn

EntireRow

Format

IsEntireColumn

IsEntireRow

LastColumn

LastRow

Name

Parent

Row

RowCount

RowHeight

Value

 

Methods

Cells

Clear

Columns

Copy

Cut

Delete

Find

Insert

Paste

PasteSpecial

Replace

Rows

Sort

Statistics

 

Example

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

 

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)

End Sub