excel怎么将单元格填充颜色的RGB数值自动显示在所在的单元格中? 图片是我手动输入的
展开全部
终于写出来了,RGB的反转不知道是否有函数,自己用16进制实现的,见笑了:
Option Explicit
Sub YgB()
Dim r As Range, x, y, z, h
For Each r In Selection
h = Hex(r.Interior.Color)
While Len(h) < 6
h = "0" & h
Wend
x = Application.WorksheetFunction.Hex2Dec(Right(h, 2))
y = Application.WorksheetFunction.Hex2Dec(Mid(h, 3, 2))
z = Application.WorksheetFunction.Hex2Dec(Left(h, 2))
r = h & "|" & x & "," & y & "," & z
Next r
End Sub
执行示例:
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询