-
Sep 19th, 2020, 05:11 AM
#1
Thread Starter
Member
[RESOLVED] Changing Object Fill Color
Hello .. Can someone help me in this please?
I have more than 180 circles shape inserted in a worksheet. I need to change the filling color of specific circle once a condition is true.
I got “Run-time error '438' - Object doesn't support this property or method” with the below code:
Code:
With Worksheets(Sheet2.Name).Shapes.Range(Array("Oval 52")).ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(112, 48, 160)
.Transparency = 0
.Solid
End With
-
Sep 19th, 2020, 07:58 AM
#2
Re: Changing Object Fill Color
you can try like
Code:
With Worksheets(Sheet2.Name).Shapes("Oval 52")
.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(112, 48, 160)
.Shadow.Transparency = 0
End With
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Sep 20th, 2020, 03:32 AM
#3
Thread Starter
Member
Re: [RESOLVED] Changing Object Fill Color
Thanks a lot. Your way is working perfectly
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|