|
-
May 26th, 2006, 10:35 AM
#1
Thread Starter
Addicted Member
RESOLVED[Colors]
To fill some shape with white color I use the following intructions:
VB Code:
ActiveSheet.Shapes(i).Select
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 1
However I'm unable to run something like
VB Code:
ActiveSheet.Shapes(i).Select
If Selection.ShapeRange.SchemeColor = 1 Then
GoTo end
Else
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 1
End If
End:
How can I write a condition on the color of a shape?
Last edited by Fonty; May 26th, 2006 at 01:02 PM.
-
May 26th, 2006, 10:50 AM
#2
Re: Colors
If Selection.ShapeRange.Fill.ForeColor.SchemeColor = 1 then
and DO NOT USE END
actually rewrite that so u dont need the goto.. try to avoid goto's unless u HAVE to use it
VB Code:
ActiveSheet.Shapes(I).Select
If Selection.ShapeRange.Fill.ForeColor.SchemeColor <> 1 Then
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 1
End If
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
May 26th, 2006, 11:08 AM
#3
Re: Colors
 Originally Posted by Static
and DO NOT USE END
In this case, End appears to be a label rather then the use of that function that we will not mention , and this appears to be Excel VBA code.
Moved to Office Development
-
May 26th, 2006, 12:18 PM
#4
Re: Colors
I know it was just a lable.... but I figured its best to just avoid it all together.. and try to avoid the goto as well
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
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
|