Link to home
Create AccountLog in
Avatar of Wilder1626
Wilder1626Flag 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

Avatar of Wilder1626
Wilder1626
Flag of Canada image

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
Avatar of Ark
Ark
Flag of Russian Federation image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thank you for your help.

This is perfect.