View Single Post
 
Old 02-19-2020, 10:37 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

So why not simply pass the RGB value as a long? That's what the code in https://www.msofficeforums.com/148862-post9.html does via:
Const w As Long = RGB(255, 255, 255)
and:
s = RGB(198, 217, 241)
for example.

Regardless, even if you want to pass the rgb values as a string, you don't need the array. You could, for example, use:
Code:
Dim r As Long, g As Long, b As Long, iLiteBlue As Long
Const sLiteBlue As String = "219,229,241"
r = Split(sLiteBlue, ",")(0)
g = Split(sLiteBlue, ",")(1)
b = Split(sLiteBlue, ",")(2)
iLiteBlue = RGB(r, g, b)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote