你是问如何从工具栏里取颜色值,而不是设置选择区域的背景色吧。
如果是自己编程要选择颜色的话,可以调出调色板来做,颜色值随便选。
附一段代码,设置单元格背景色:
For i = 1 To 56
Range("A" & i) = i
Range("B" & i).Interior.ColorIndex = i
Next i
Sub a()
Dim c As CommandBar
Set c = Application.CommandBars("Formatting")
Dim cc As CommandBarControl
For Each cc In c.Controls
If cc.ID = 1691 Then
MsgBox cc.TooltipText
End If
Next
End Sub