hi all,
I have several shapes in a sheet1 and now for each shape i have defined a userform which put some values in sheet2 now i want to change the color of each shape when the specified cells in sheet2 get value. how can i use vba to do this
thanks
hi all,
I have several shapes in a sheet1 and now for each shape i have defined a userform which put some values in sheet2 now i want to change the color of each shape when the specified cells in sheet2 get value. how can i use vba to do this
thanks
Here's how to change the color of "Oval 1" on sheet one by inputting a RGB integer (e.g. 65142) into cell A1 on Sheet 2. Not sure if it's the best way, as I rarely deal with shapes, but it's tested as working.
![]()
Private Sub Worksheet_Change(ByVal Target As Range) Dim sh As Shape If Target.Address = "$A$1" Then For Each sh In Worksheets("Sheet1").Shapes If sh.Name = "Oval 1" Then sh.Fill.ForeColor.RGB = Target.Value Next End If End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks