2017-05-26 81 views
0

我使用调色板将单元格1的背景颜色设置为White, background 1, darker 15%使用VBA在Excel中设置相同的单元格颜色,在主题颜色中显示选区

colour selection

然后我使用VBA这种颜色复制到下一个单元:

oOutSheet.Cells(1, 2).Interior.Color = oOutSheet.Cells(1, 1).Interior.Color 

第二小区的颜色将是相同的灰度,但在主题颜色调色板未选中在这里看到:

colour selection 2

为什么“主题颜色”项不突出显示为White, background 1, darker 15%,我该怎么做?

+0

我可以从VBA设置主题颜色? –

+0

我可以通过ThemeColor和TintAndShade来设置它 –

回答

0

如果oOutSheet.Cells(1, 1).Interior.ThemeColor = 1 -> 12值 我可以设置:

Dim tint as double 
tint=oOutSheet.Cells(1, 1).Interior.TintAndShade 
oOutSheet.Cells(1, 2).Interior.ThemeColor =oOutSheet.Cells(1, 1).Interior.ThemeColor 
oOutSheet.Cells(1, 2).Interior.TintAndShade = tint 
相关问题