|
-
Dec 3rd, 2024, 09:54 AM
#1
Thread Starter
New Member
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:

And I want them to look like this:

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.
-
Dec 3rd, 2024, 11:06 AM
#2
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
-
Dec 3rd, 2024, 02:15 PM
#3
Re: How to partially merge rows & cells
VBFlexGrid MergeCells can span multiple rows and columns together.
-
Dec 12th, 2024, 08:09 AM
#4
Thread Starter
New Member
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...
-
Dec 12th, 2024, 08:33 AM
#5
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)
-
Dec 12th, 2024, 09:12 AM
#6
Thread Starter
New Member
Re: How to partially merge rows & cells
Thank you. I was looking for a confirmation.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|