Option Explicit
Const MAX_COL As Long = 8
Const MAX_ROW As Long = 2
Const START_ROW As Long = 2
Const START_COL As Long = 2
Sub Color()
Dim i As Integer
Dim intRow As Long, intCol As Long
Cells.Select
Selection.ClearContents
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
For i = 1 To 56
intRow = Int((i / MAX_COL) - 0.0000001)
intCol = IIf(i Mod MAX_COL = 0, MAX_COL, i Mod MAX_COL) + START_COL - 1
'Color
Cells((intRow * MAX_ROW) + START_ROW, START_COL).Value = "Color"
Cells((intRow * MAX_ROW) + START_ROW, intCol).Offset(, 1).Interior.colorIndex = i
'.ColorIndex
Cells((intRow * MAX_ROW) + START_ROW, START_COL).Offset(1).Value = "Index"
Cells((intRow * MAX_ROW) + START_ROW, intCol).Offset(1, 1).Value = i
Next i
Range("A1").Select
End Sub
1-2. 运行结果如下
2. QBColor
2-1. QBColor的值是从0到15。
Sub sbQBColor()
Dim i As Long
Cells.Select
Selection.ClearContents
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
For i = 0 To 15
Range("B" & i + 2).Value = i
Range("C" & i + 2).Interior.Color = VBA.QBColor(i)
Next i
Range("A1").Select
End Sub
报错1:Package pkg-config is not available, but is referred to by another package
/bin/sh: 1: pkg-config: not found(没有安装pkg-config) sudo apt-get install pkg-config /bin/sh: 1: cc: not found(没有安装gcc环境&am…