hi,
i have some functions, where i can manipulate shapes like coloring them by numbers.
what i am searching for is a solution to adopt my code, that i can color the shapes with rgb colors numbers. to be precise i want to give it the rgb color numbers by cell entries (only the number).
how can i adopt this code to get it out???:
Function ShapeCol3(Name As String, RGB) '-> r, g, b.... how??
Dim rng As Range
Application.Volatile
With ActiveSheet.Shapes(Name)
.Fill.ForeColor.RGB = RBG(rng.Offset(0, 1).Value, rng.Offset(0, 2).Value, rng.Offset(0, 3).Value)
End With
End Function
and see the workbook
RGB Colors for shapes
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
RGB Colors for shapes
You do not have the required permissions to view the files attached to this post.
-
- 5StarLounger
- Posts: 818
- Joined: 24 Jan 2010, 15:56
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: RGB Colors for shapes
ok, and how do i?
-
- 5StarLounger
- Posts: 818
- Joined: 24 Jan 2010, 15:56
Re: RGB Colors for shapes
Code: Select all
Function ShapeCol3(Name As String, Red as Byte, Green as Byte, Blue as Byte)
Application.Volatile
With ActiveSheet.Shapes(Name)
.Fill.ForeColor.RGB = RBG(Red, Green, Blue)
End With
End Function
Regards,
Rory
Rory
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: RGB Colors for shapes
ok, but it says, function or sub not defined with a link to RGB...
-
- 5StarLounger
- Posts: 818
- Joined: 24 Jan 2010, 15:56
Re: RGB Colors for shapes
I didn't spot your original typo - it should be RGB and not RBG!
Regards,
Rory
Rory
-
- 4StarLounger
- Posts: 415
- Joined: 29 Mar 2010, 11:50
- Location: Vienna, Austria
Re: RGB Colors for shapes
cool, thank You!!!