LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
MD MD is offline
external usenet poster
 
Posts: 9
Default Identify and differ msoRectangle, option button textbox

Good morning all,

I have sheets that contain Option buttons, Text boxes, Shapes (rectangles).
I would like to identify what they are and do a loop that does this.

If it's a shape with no fill color (transparent), do nothing
If it's an option button, change from msoGradientMoss to
msoGradientParchment
If it's Text box with no color (transparent), do nothing

If it's Text box with color fill color X change to fill color Y


Regards,

MD

This is what I have but it doesn't work fully.

Sub test()
MyTotal = ActiveSheet.Shapes.Count
Dim MyColor
i = 1
Start1:
ActiveSheet.Shapes(i).Select ' selects a shape to modify
On Error GoTo start2
MyColor = Selection.ShapeRange.Fill.ForeColor.SchemeColor
If MyColor = 39 Then Selection.ShapeRange.Fill.ForeColor.SchemeColor =
64: i = i + 1: GoTo Start1
If MyColor = 15 Then Selection.ShapeRange.Fill.ForeColor.SchemeColor =
64: i = i + 1: GoTo Start1
If Selection.ShapeRange.Fill.Visible = msoFalse Then i = i + 1: MyColor
= 0: GoTo Start1
i = i + 1
GoTo Start1
start2:

ActiveSheet.Shapes(i).Select ' selects a shape to modify
If Selection.ShapeRange.Fill.Visible = msoFalse Then
i = i + 1
If i MyTotal Then GoTo end_sub
GoTo start2
Else

If Selection.ShapeRange.Fill.ForeColor.SchemeColor = 64 Then i = i + 1:
GoTo start2
If MyColor = 0 Then i = i + 1: GoTo start2
Selection.ShapeRange.Fill.PresetGradient msoGradientFromCenter, 1,
msoGradientParchment
i = i + 1
If i MyTotal Then GoTo end_sub

GoTo start2
End If

end_sub:
End Sub



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to identify macro assigned to toolbar button Patricia D Excel Discussion (Misc queries) 3 April 6th 09 04:31 AM
Formula to Identify Col Data-Pairs that Differ by 2*pi monir Excel Worksheet Functions 2 November 22nd 07 03:47 AM
end down option in a textbox of a form DTGvet Excel Discussion (Misc queries) 1 June 15th 06 02:01 PM
HOW DO I COMPARE TWO SHEETS AND IDENTIFY WHICH CELLS DIFFER STEVE THE PARTS GUY Excel Discussion (Misc queries) 1 March 2nd 06 07:13 PM
keep source formatting is not an option in paste option button Tina Excel Discussion (Misc queries) 0 February 20th 06 09:58 PM


All times are GMT +1. The time now is 06:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"