LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Centering a Shape over a given cell when resizing

Hi,

I have a macro set up to re-size a Shape (or Autoshape -- it's a trapezoid)
based on values input into a cell on the spreadsheet. The problem is that it
looks like the macro is simply extending one side of the Shape rather than
all sides of the shape equally, resulting in the object no longer being
centered over the same point in the spreadsheet it was originally centered
over. I need to find a way to have the Shape remain centered over the same
point in the spreadsheet after being re-sized.

Below is the code I have for the re-sizing -- any help is greatly appreciated!

ActiveSheet.Shapes("AutoShape 18").Select

sourcevar = Range("C9").Value - 0.167 + 1

If sourcevar < 1.5 Then
Selection.ShapeRange.Height = 83.57763975 * sourcevar
Selection.ShapeRange.Width = 99.1875 * sourcevar
Else

Selection.ShapeRange.Height = 83.57763975 * 1.5
Selection.ShapeRange.Width = 99.1875 * 1.5
End If
 
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
Cell Text Alignment - Not A Centering Issue Minitman Excel Discussion (Misc queries) 4 July 14th 08 08:42 AM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Resizing cells in a selection without resizing entire sheet Danielle via OfficeKB.com Excel Discussion (Misc queries) 4 August 11th 06 10:06 PM
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 02:09 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"