-
I am using the following code to color all the cells in column 1 and 2. However, only the first two rows of columns 1 and 2 are changing color.
With MSFlexGrid1
.col = 1
.cellbackcolor = vbRed
.col = 2
.cellbackcolor = vbblue
End With
Can someone show me a method to color the entire 2 columns.
-
you need to cycle through the rows.
for intI = 0 to MSFlexGrid1.rows -1
.row = inti
'do the col colors here
next inti
-
An easier method would be to set the RowSel property and also set the FillStyle Property to flexFillRepeat, ie.
Code:
Private Sub Command1_Click()
With MSFlexGrid1
.Row = 0
.Col = 1
.FillStyle = flexFillRepeat
.RowSel = .Rows - 1
.ColSel = 1
.CellBackColor = vbRed
.Col = 2
.ColSel = 2
.RowSel = .Rows - 1
.CellBackColor = vbBlue
.Col = 0
.FillStyle = flexFillSingle
End With
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Aaron, I didn't think of that. I forgot about the FillRepeat option. That would work way better.