I have a number of colored buttons on a form that, when clicked, fire the
following macro:
Private Sub Image300_Click()
On Error Resume Next
Dim Pass_color As MsoRGBType 'Define variable
Pass_color = 11954700 'Variable gets a color
Call Color_macros.Color_single_click(Pass_color) 'Pass color to macro
End Sub
This color is then passed to the following (simplified) macro:
Public Sub Color_single_click(My_color As MsoRGBType)
On Error Resume Next
'Color passed from button
Selection.Font.Color = My_color 'Change text color
End Sub
However, I would like to use RGB values such as RGB(12, 106, 182) instead of
11954700.
Can anyone tell me how I can do this?
thanks,
androo
Dave Lett - 06 Nov 2006 19:00 GMT
Hi,
You were close
Public Sub Color_single_click(iRed As Integer, iGreen As Integer, iBlue As
Integer)
Selection.Font.Color = RGB(iRed, iGreen, iBlue)
End Sub
Public Sub Newsgroup()
Color_single_click iRed:=12, iGreen:=106, iBlue:=182
End Sub
HTH,
Dave
>I have a number of colored buttons on a form that, when clicked, fire the
>following macro:
[quoted text clipped - 21 lines]
> thanks,
> androo
Karl E. Peterson - 06 Nov 2006 19:19 GMT
> I have a number of colored buttons on a form that, when clicked, fire
> the following macro:
[quoted text clipped - 5 lines]
> Call Color_macros.Color_single_click(Pass_color) 'Pass color to
> macro End Sub
<snip>
> However, I would like to use RGB values such as RGB(12, 106, 182)
> instead of 11954700.
>
> Can anyone tell me how I can do this?
Ummm, "Just do it!"?
Call Color_macros.Color_single_click(RGB(12, 106, 182))

Signature
Working without a .NET?
http://classicvb.org/
androo... - 06 Nov 2006 22:00 GMT
Thanks. Both of these work perfectly.
androoooooooooooo.....................