Avatar of Wilder1626
Wilder1626
Flag for Canada asked on

If more than 12 characters in MSFlexGrid1 cell from column 2

Hello all

I would like to put each cell that have more then 12 characters in orange in my MSFlexGrid1 column 2.

How can i do that?

Thanks again

Dim j As Long
 Dim iCount As Integer

    iCount = 0
For j = 1 To Form6.MSFlexGrid1.Rows - 1



If Left(Form6.MSFlexGrid1.TextMatrix(j, 2), 13) <> "" Then
   
   Form6.MSFlexGrid1.Row = j
   Form6.MSFlexGrid1.Col = 2
   Form6.MSFlexGrid1.CellBackColor = &H80FF&
   iCount = iCount + 1
End If

Next
msgbox  iCount

Open in new window

Visual Basic Classic

Avatar of undefined
Last Comment
Wilder1626

8/22/2022 - Mon
Wilder1626

ASKER
I think i have it:

Dim j As Long
 Dim iCount As Integer

    iCount = 0
For j = 1 To Form6.MSFlexGrid1.Rows - 1



If Form6.MSFlexGrid1.TextMatrix(j, 2) > Left(Form6.MSFlexGrid1.TextMatrix(j, 2), 12) Then
   
   Form6.MSFlexGrid1.Row = j
   Form6.MSFlexGrid1.Col = 2
   Form6.MSFlexGrid1.CellBackColor = &H80FF&
   iCount = iCount + 1
End If

Next
record_type = iCount

Open in new window

ASKER CERTIFIED SOLUTION
Ark

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Wilder1626

ASKER
Thank you for your help.

This is perfect.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck