1

I have a small MSFlexGrid with 1 fixed column, and 2 fixed rows.

enter image description here

As you can see MergeRow works in the top row.

I want the 2 top cells from the first column to merge as well, but the separation remains.

The code I am using is:

with grdPrm
  .MergeCells = 1
  .MergeRow(0) = True
  .MergeCol(0) = True
  .TextMatrix(1, 0) = .TextMatrix(0, 0)
End With 'grdPrm

I tried the values 0,1,2,3,4 for MergeCells as well as the constants flexMergeFree and flexMergeRestrictBoth.

Does anyone know why MergeCol does not work for me?

Hrqls
  • 2,944
  • 4
  • 34
  • 54
  • One important thing I noticed: Make sure that GridLinesFixed is set to 2(flexGridInset). When it is set to 3(flexGridRaised), the cell grid line is still visible even after merging. Probably, this is the cause of your problem. Check my modified answer – rags May 30 '13 at 10:14

1 Answers1

1

It appears that .TextMatrix(1, 0) = .TextMatrix(0, 0) does not make the contents exactly equal.

MergeCol does work when I replace that line with:

.TextMatrix(0, 0) = "    "
.TextMatrix(1, 0) = "    "

It probably has something to do that I originally filled TextMatrix(0,0) via the .FormatString property:

.FormatString = "^    " & "|> " & strFC(0) & " |> " & strFC(0) & " " & ......

Apparently .TextMatrix(1, 0) = .TextMatrix(0, 0) only assigns the contents, while MergeCol also checks for more than that (like explicit formatting)

Hrqls
  • 2,944
  • 4
  • 34
  • 54