Avatar of Wilder1626
Wilder1626
Flag for Canada asked on

VB6 convert MSHFlexgrid1 cells

Hi,

I have this MSHFlexgrid1 where in Column 0,1 and 11, I may have multiple rows with the same values. Everything is already sorted by those 3 columns.

Using this:
    With MSHFlexGrid1
     .ColSel = 11
        .Sort = flexSortStringAscending
        .ColSel = 1
        .Sort = flexSortStringAscending
        .ColSel = 0
        .Sort = flexSortStringAscending
    End With

Open in new window


What i would like to do is that if i have multiple rows with the same value in column 0, 1 and 11, it will leave all cell populated  as it is and also add the letter "H" in column 4 of the first row only.
Then, it will empty the value in column 3 and add the letter "D" in column 4.

Example of the grid before the macro:
Before_sample
Then after the macro:
Macro_result
What would be the best way to do that as i can have up to 7000 rows in the grid.

I have put a sample of the project in attachment.

Thanks for your help
Visual Basic Classic

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
Martin Liss

Can you supply a project zip file please?
Wilder1626

ASKER
wow, sorry, here it is.
Projet1.zip
Martin Liss

The zip only contains the vbp file. I need the whole thing, or at least Form1.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Wilder1626

ASKER
That zip will do. sorry again :)
Projet1.zip
ASKER CERTIFIED SOLUTION
Martin Liss

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Wilder1626

ASKER
You are right about the CAD / CAN

Thanks a lot for your help. this works like a charm.
Martin Liss

As always...
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.