Función RGB [VBA]

Devuelve un valor cromático en forma de entero Long (largo) que consiste de componentes rojo, verde y azul, según la fórmula de colores de VBA.

warning

Esta constante, función u objeto se activa mediante la instrucción Option VBASupport 1, colocada antes del código ejecutable del programa en un módulo.


Sintaxis:


RGB (Red, Green, Blue)

Valor de retorno:

Long

Parámetros:

red: Any integer expression that represents the red component (0-255) of the composite color.

green: Any integer expression that represents the green component (0-255) of the composite color.

blue: Any integer expression that represents the blue component (0-255) of the composite color.

warning

Because of the VBA compatibility mode (Option VBASupport 1), the Long value is calculated as
Result = red + green×256 + blue×65536.


Códigos de error:

5 Llamada a procedimiento no válida

Ejemplo:


Option VBASupport 1
Sub ExampleRGBVBA
Dim lVar As Long
    lVar = rgb(128,0,200)
    Print lVar; ' returns 13107328
End Sub

¡Necesitamos su ayuda!