Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
autoshapes - identification and property change
Hi All,
I have theree rectangles in a spreadsheet, each calls a cell in order to display a value (i.e =A1). I tried to change object colors, size based on the values displayed - for example - to scale size of the object. How to do this? I used macro recorder, but I cant get into object properties - as the editor, didnt show the drawing objects in the code? Many thanks, Marcin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
autoshapes - identification and property change
Hi Marcin,
The following should help. Note the comments and also that some of the lines of code are commented out and are there to show alternatives and additional code that might be helpful in the example. With ActiveSheet.Shapes("Rectangle 1") .Width = 50 .Height = 20 'Use following if width and height in cell values '.Width = ActiveSheet.Range("A1") '.Height = ActiveSheet.Range("A2") 'Lookup RGB function for more colors .Fill.ForeColor.RGB = RGB(255, 255, 0) 'Yellow '.Fill.ForeColor.RGB = RGB(0, 0, 255) 'Blue 'Alternative color code. 'Test SchemeColors for required color. '.Fill.ForeColor.SchemeColor = 1 'White '.Fill.ForeColor.SchemeColor = 0 'Black 'Scales the shape (Numbers less than 1 reduce; greater than 1 enlarge) '.ScaleWidth 0.73, msoFalse, msoScaleFromTopLeft '.ScaleHeight 0.57, msoFalse, msoScaleFromTopLeft End With -- Regards, OssieMac "Marcin Peciak" wrote: Hi All, I have theree rectangles in a spreadsheet, each calls a cell in order to display a value (i.e =A1). I tried to change object colors, size based on the values displayed - for example - to scale size of the object. How to do this? I used macro recorder, but I cant get into object properties - as the editor, didnt show the drawing objects in the code? Many thanks, Marcin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I change an AutoShapes Callout line gap ? | Charts and Charting in Excel | |||
How do you change the default text alignment for Excel autoshapes | Excel Discussion (Misc queries) | |||
change all the autoshapes | Excel Programming | |||
'On change' property | Excel Programming | |||
DrawingObjects/AutoShapes' .OnAction property in DialogSheets | Excel Discussion (Misc queries) |