咦,又是你,楼主跟表格干上了Private Sub Command1_Click() Dim lngRow As Long Dim lngCol As Long
lngCol = 1 '改变第一列的背景色 With MSFlexGrid1 .Col = lngCol For lngRow = .FixedRows To .Rows - 1 .Row = lngRow .CellBackColor = vbBlue Next End With End SubPrivate Sub Command2_Click() Dim lngRow As Long Dim lngCol As Long
lngRow = 1 '改变第二行的背景色 With MSFlexGrid1 .Row = lngRow For lngCol = .FixedCols To .Cols - 1 .Col = lngCol .CellBackColor = vbRed Next End With End Sub 。
Dim lngRow As Long
Dim lngCol As Long
lngCol = 1 '改变第一列的背景色
With MSFlexGrid1
.Col = lngCol
For lngRow = .FixedRows To .Rows - 1
.Row = lngRow
.CellBackColor = vbBlue
Next
End With
End SubPrivate Sub Command2_Click()
Dim lngRow As Long
Dim lngCol As Long
lngRow = 1 '改变第二行的背景色
With MSFlexGrid1
.Row = lngRow
For lngCol = .FixedCols To .Cols - 1
.Col = lngCol
.CellBackColor = vbRed
Next
End With
End Sub
。
是这么回事吗?