XLS Object
 
Syntax
 
XLS.SelectRange Row1, Col1[, Row2][, Col2][, ApplyFont][, Alignment][, Highlight]
 
Description
Selects a range of cells and optionally applies some formatting on the selection.
 
The span can hold multiple rows and columns. Please take notice that the rows and colums are one-based arrays. Therefore, when referring to Excel cell "A1", row and column numbers are 1 and 1.
 
Parameter
Description
Row1
Long integer, required. The first row in the range.
Col1
Integer, required. The first column in the range.
Row2
Long integer, optional. The last row in the range. If omitted, only cells from Row1 are selected
Col2
Integer, optional. The last column in the range. If omitted, only the rows in Col1 are selected
ApplyFont
Boolean, optional. When True, the range's font settings will be set using the XLS.Font properties. Default value is False.
Alignment
Enumerated, optional. Applies alignment using these values:
xlAlignCenter
xlAlignDistributed
xlAlignJustify
xlAlignLeft
xlAlignNotApplicable (this is the default value when omitted)
xlAlignRight
Highlight
Boolean, optional. When True, the selection will be highlighted using standard highlight color settings.
 
See Also
Example
 
Sub Main
 
Dim x As Integer
 
   If Not XLS.AppInit() Then Exit Sub
 
   XLS.AppVisible = True
 
   XLS.AddWorkBook
   XLS.AddWorkSheet "Test1"
 
   For x = 1 To 10
      XLS.Value(x, 1) =  "Waarde " & CStr(x)
   Next x
 
   XLS.Font.Bold = True
 
   XLS.SelectRange 3, 1, 5, 1, True, xlAlignRight , True
 
   XLS.AppClose
 
End Sub