2 Attachment(s)
How to partially merge rows & cells
Hi,
In my mshflexgrid I have - let's say - 4 columns.
In the last 2 rows of my mshflexgrid, I want to merge rows and columns but only within the first 2 columns.
For Example, I have last 2 rows of my grid looking like this:
Attachment 193627
And I want them to look like this:
Attachment 193628
Is this possible to achieve without adding some hidden columns etc.? I want all my data above the last 2 rows to have cells not merged.
Re: How to partially merge rows & cells
It seems that merging a row and column at the same time give strange effects.
Also a cell needs to contain data to be merged.
This was the best I could achieve with some basic tests
Code:
Option Explicit
Private Sub Form_Load()
With MSHFlexGrid1
.Rows = 4
.Cols = 4
.FixedRows = 0
.FixedCols = 0
.TextMatrix(0, 2) = "Some Text 1"
.TextMatrix(0, 3) = "Some Text 2"
.TextMatrix(0, 0) = " "
.TextMatrix(0, 1) = " "
.TextMatrix(1, 0) = " "
.TextMatrix(1, 1) = " "
.MergeCells = flexMergeFree
End With
End Sub
Private Sub Command1_Click()
With MSHFlexGrid1
.MergeRow(0) = True
.MergeRow(1) = True
End With
End Sub
Private Sub Command2_Click()
With MSHFlexGrid1
.MergeCol(0) = True
.MergeCol(1) = True
End With
End Sub
Re: How to partially merge rows & cells
VBFlexGrid MergeCells can span multiple rows and columns together.
Re: How to partially merge rows & cells
I am unable to find an example online that will show how to use MergeCells property to combine cells with the same value in both rows and columns at the same time. It is either merging cells in a row or in a column...
Re: How to partially merge rows & cells
The MS(H)FlexGrid is not capable of doing this.
It's either in the column or in the row, not both.
Check the vbFlexGrid by Kr00l: https://www.vbforums.com/showthread....xGrid-control)
Re: How to partially merge rows & cells
Thank you. I was looking for a confirmation.