gpt4 book ai didi

vba - 为什么 Excel RGB 值向后?

转载 作者:行者123 更新时间:2023-12-01 23:51:40 24 4
gpt4 key购买 nike

<分区>

这个函数是一个例子。请注意,RGB 值实际上是 BGR 值。为什么excel会这样?

 Function GetRGB(ByVal cell As Range) As String

Dim R As String, G As String
Dim b As String, hexColor As String
hexCode = Hex(cell.Interior.Color)

'Note the order excel uses for hex is BGR.
b = Val("&H" & Mid(hexCode, 1, 2))
G = Val("&H" & Mid(hexCode, 3, 2))
R = Val("&H" & Mid(hexCode, 5, 2))

GetRGB = R & ":" & G & ":" & b
End Function

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com