We help IT Professionals succeed at work.
Get Started

Contactenate MSHFlexgrid1 issue

Wilder1626 asked
Last Modified: 2012-07-04
Hi All,

I would need your help to modify that code here:
Dim k As Long

For k = 1 To MSHFlexGrid1.Rows - 1

If MSHFlexGrid1.TextMatrix(k, 1) <> "" Then
   MSHFlexGrid1.TextMatrix(k, 11) = MSHFlexGrid1.TextMatrix(k, 0) & MSHFlexGrid1.TextMatrix(k, 1) & MSHFlexGrid1.TextMatrix(k, 7) & MSHFlexGrid1.TextMatrix(k, 8) & MSHFlexGrid1.TextMatrix(k, 9) & MSHFlexGrid1.TextMatrix(k, 10)

  End If

Next k

Open in new window

What I'm trying to do is to follow these criteria:
If rows from Column 0, 1 and 2 are the same on multiple rows, then it must concatenate all  rows with column 0, 1, 7, 8, 9, 10 in column 11 until a new value from column 0,1,2.

Foe example. If we look at the picture bellow, we see the same value 28, 16 and 00221 on 7 rows.

Then it will concatenate in all rows column 11 all the values of all rows column 0, 1, 7, 8, 9, 10 of the 7 rows to make this result:

Open in new window

The number of rows with same value in column 0, 1 , 2 may vary.

How can i do that please?

Thanks for your help.Grid to concatenate
Watch Question
Top Expert 2012
This problem has been solved!
Unlock 1 Answer and 20 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE