change color font in entire row in msflexgrid

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

change color font in entire row in msflexgrid

Post by sal21 »

How to change color font (red) from row 3 to the end of last column in msflexgrid

in my case have 7 column

User avatar
HansV
Administrator
Posts: 78542
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: change color font in entire row in msflexgrid

Post by HansV »

Do you really mean from row 3? Or from column 3 to column 7?
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

Re: change color font in entire row in msflexgrid

Post by sal21 »

HansV wrote:
29 Sep 2023, 09:54
Do you really mean from row 3? Or from column 3 to column 7?
Yes, from row 3 to the end of column

User avatar
HansV
Administrator
Posts: 78542
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: change color font in entire row in msflexgrid

Post by HansV »

I cannot test this myself.

Code: Select all

Sub Test()
    Dim r As Long
    Dim c As Long
    With Me.MSFlexGrid1
        For r = 2 To .Rows - 1
            For c = 0 To 6
                .Row = r
                .Col = c
                .CellForeColor = vbRed
            Next c
        Next r
    End With
End Sub
Best wishes,
Hans