XLS Object
 
Syntax
 
XLS.MergeCells Row1, Col1, Row2, Col2
 
Description
Merges two or more cells in the selected range into one single cell.
 
Cell merge is a common feature in tables as in Excel as well. 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, required. The last row in the range.
Col2
Integer, required. The last column in the range.
 
See Also
Example
 
Sub Main
 
Dim x As Integer
 
   If Not XLS.AppInit() Then Exit Sub
 
   XLS.AppVisible = True
 
   XLS.AddWorkBook
   XLS.AddWorkSheet "Test1"
 
   XLS.MergeCells 3, 1, 6, 1
 
   For x = 1 To 10
      XLS.Value(x, 1) =  "Waarde " & CStr(x)
   Next x
 
   For x = 1 To 10
      Debug.Print XLS.Value(x, 1)
   Next x
 
   XLS.AppClose
 
End Sub