Link to home
Start Free TrialLog in
Avatar of Wilder1626
Wilder1626Flag for Canada

asked on

VB6 - Delete row if specific cell in Grid have a specific color

Hi.

I would like to know how i can delete all rows of my MSHFlexgrid1 that are not with a back color: &H80FF& in column 1.

How can i do that please?

Thanks

  Dim i As Long
    For i = MSHFlexGrid1.Rows - 1 To 1 Step -1
    
        If MSHFlexGrid1.TextMatrix(i, 1) .CellBackColor <> &H80FF& Then
        MSHFlexGrid1.RemoveItem i
        Else
            
        End If
    Next

Open in new window

Avatar of Martin Liss
Martin Liss
Flag of United States of America image

What happens when you run that code? Does it compile?
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wilder1626

ASKER

This is perfect.

Thanks again for your help.
You're welcome.