RGB Function [VBA]/text/sbasic/shared/03010306.xhpRGB function [VBA]
RGB Function [VBA]
Returns a Long integer color value consisting of red, green, and blue components, according to VBA color formula.RGB (Red, Green, Blue)LongBecause of the VBA compatibility mode (Option VBASupport 1), the Long value is calculated as Result = red + green×256 + blue×65536.
Option VBASupport 1Sub ExampleRGBVBADim lVar As Long lVar = rgb(128,0,200) Print lVar; ' returns 13107328End Sub