Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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
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
Creating Bell Shape Khaledity Excel Worksheet Functions 1 June 28th 09 02:37 AM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
creating controls at runtime defj Excel Programming 2 December 2nd 03 07:14 AM
Deleting a shape and the cell contents the shape is in. Dave Peterson[_3_] Excel Programming 1 October 9th 03 03:36 PM
Deleting a shape and the cell contents the shape is in. Tom Ogilvy Excel Programming 0 October 9th 03 03:43 AM


All times are GMT +1. The time now is 11:43 AM.

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

About Us

"It's about Microsoft Excel"