Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating Shape at runtime
Good Evening,
Any suggestions how to "clean" below code? My code is working as intented but looks "amateurish". Brgds CG Rosén Range("A1").Select ActiveSheet.Shapes.AddTextEffect(msoTextEffect1, "Filed", "Sylfaen", 36#, _ msoFalse, msoFalse, 329.25, 188.25).Select Selection.ShapeRange.ScaleWidth 1.65, msoFalse, msoScaleFromTopLeft Selection.ShapeRange.ScaleHeight 0.98, msoFalse, msoScaleFromBottomRight Selection.ShapeRange.IncrementRotation -26.33 Selection.ShapeRange.IncrementLeft -164.25 Selection.ShapeRange.IncrementTop 40.5 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating Shape at runtime
I would use something like the following:
With ActiveSheet.Shapes.AddTextEffect(msoTextEffect1, _ "Filed", _ "Sylfaen", _ 36#, _ msoFalse, _ msoFalse, _ Range("D20").Left, _ Range("D20").Top) .ScaleWidth 1.65, msoFalse, msoScaleFromTopLeft .ScaleHeight 0.98, msoFalse, msoScaleFromBottomRight .IncrementRotation -26.33 .IncrementLeft 0 .IncrementTop 0 End With The top left of the original text is aligned with the D20 cell, which you can change to suit your spreadsheet layout and which will probably allow you to eliminate the IncrementLeft and IncrementTop lines.I have left them in if you want to add fine adjustments. The ScaleHeight line could also be eliminated if you are not too picky. It is only adjusting the height to 98% of its original height. -- John Green - Excel MVP Sydney Australia "CG Rosén" wrote in message ... Good Evening, Any suggestions how to "clean" below code? My code is working as intented but looks "amateurish". Brgds CG Rosén Range("A1").Select ActiveSheet.Shapes.AddTextEffect(msoTextEffect1, "Filed", "Sylfaen", 36#, _ msoFalse, msoFalse, 329.25, 188.25).Select Selection.ShapeRange.ScaleWidth 1.65, msoFalse, msoScaleFromTopLeft Selection.ShapeRange.ScaleHeight 0.98, msoFalse, msoScaleFromBottomRight Selection.ShapeRange.IncrementRotation -26.33 Selection.ShapeRange.IncrementLeft -164.25 Selection.ShapeRange.IncrementTop 40.5 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating Shape at runtime
Hi John,
Thanks for your answer! Brgds CG Rosén "John Green" wrote in message ... I would use something like the following: With ActiveSheet.Shapes.AddTextEffect(msoTextEffect1, _ "Filed", _ "Sylfaen", _ 36#, _ msoFalse, _ msoFalse, _ Range("D20").Left, _ Range("D20").Top) .ScaleWidth 1.65, msoFalse, msoScaleFromTopLeft .ScaleHeight 0.98, msoFalse, msoScaleFromBottomRight .IncrementRotation -26.33 .IncrementLeft 0 .IncrementTop 0 End With The top left of the original text is aligned with the D20 cell, which you can change to suit your spreadsheet layout and which will probably allow you to eliminate the IncrementLeft and IncrementTop lines.I have left them in if you want to add fine adjustments. The ScaleHeight line could also be eliminated if you are not too picky. It is only adjusting the height to 98% of its original height. -- John Green - Excel MVP Sydney Australia "CG Rosén" wrote in message ... Good Evening, Any suggestions how to "clean" below code? My code is working as intented but looks "amateurish". Brgds CG Rosén Range("A1").Select ActiveSheet.Shapes.AddTextEffect(msoTextEffect1, "Filed", "Sylfaen", 36#, _ msoFalse, msoFalse, 329.25, 188.25).Select Selection.ShapeRange.ScaleWidth 1.65, msoFalse, msoScaleFromTopLeft Selection.ShapeRange.ScaleHeight 0.98, msoFalse, msoScaleFromBottomRight Selection.ShapeRange.IncrementRotation -26.33 Selection.ShapeRange.IncrementLeft -164.25 Selection.ShapeRange.IncrementTop 40.5 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating Bell Shape | Excel Worksheet Functions | |||
my curser changed from arrow shape to a cross shape???? | New Users to Excel | |||
creating controls at runtime | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming |