]]>
MS Office 2010 Excel VBA IDE IntelliSense AutoFreeze "feature"
Leave a reply
]]>
Sub color2RGB(myColor As Long, RGBComponents() As Byte) RGBComponents(0) = (myColor And &HFF0000) \ &H10000 RGBComponents(1) = (myColor And &HFF00&) \ &H100 RGBComponents(2) = (myColor And &HFF&) End Sub
Function offsetColor(myColor As Long, Optional R As Integer = 0, Optional G As Integer = 0, Optional B As Integer = 0) As Long Dim RGBComponents(2) As Byte Call color2RGB(myColor, RGBComponents()) R = (R + RGBComponents(0)) Mod &HFF If R < 0 Then R = 0 G = (G + RGBComponents(0)) Mod &HFF If G < 0 Then G = 0 B = (B + RGBComponents(0)) Mod &HFF If B < 0 Then B = 0 offsetColor = RGB(R, G, B) End Function
?Hex(offsetColor(myColor:=0, R:=1, G:=2, B:=3)) 30201
MyObject.Color = RGB(255, 0, 0) ' Set the Color property of MyObject to Red.
myCell.Comment.Shape.TextFrame.AutoSize = True