【发布时间】:2011-09-11 17:20:45
【问题描述】:
我想用 vba 生成一个特定布局的 excel 表。我的子程序之一是字体颜色。它看起来像这样:
Sub SetFont(cell1, cell2 As range, fcolor As String)
range(cell1, cell2).Select
If fcolor = "w" Then
With Selection.Font
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
End With
ElseIf fcolor = "b" Then
With Selection.Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
End If
End Sub
但它不起作用。字体始终以黑色生成。我不知道为什么。
【问题讨论】: