且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

VBA存储RGB颜色在变量

更新时间:2023-11-04 12:32:28

RGB 返回 code>,因此您需要将 clrBlue 声明为 Long ,而不是 ColorFormat

RGB returns a Long, so you need to declare clrBlue as Long instead of as ColorFormat.

Dim clrBlue As Long

clrBlue = RGB(0, 0, 256)

Application.union(Range("A2"), Range("B3")).Interior.Color = clrBlue