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: 270
Default AutoShape Re-Sizing IS KILLING ME!!!!

I have added an autoshape, then copied an Excel table over to it, and grouped
them together. In VB there is the following code, that brings up the
autoshape whenever someone clicks on a cell in the range of L2:L200, and
anchors the shape to that cell:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Box190 As Shape
Set Box190 = Me.Shapes("Group 190")

If Not (Intersect(Target, Range("L2:L200")) Is Nothing) Then
With Target
Shapes("Group 190").Visible = True
If Selection.Left + Selection.Width + Box190.Width Rows(1).Width
Then
Box190.Left = Selection.Left - Box190.Width
Else: Box190.Left = Selection.Left + Selection.Width
End If
If Selection.Top + Selection.Height + Box190.Height
Columns(1).Height Then
Box190.Top = Selection.Top - Box190.Height
Else: Box190.Top = Selection.Top + Selection.Height
End If
Box190.ZOrder msoBringToFront
End With
Else: Shapes("Group 190").Visible = False
End If

The problem is that the autoshape keeps changing sizes, I assume as a result
of other copy/paste/clear actions taken at different times. I have tried
setting the format of each autoshape (including the original shape, the
picture added, and the group) to all variations possible...don't move/size,
etc. When the other macros are run to copy/paste/clear, I set
application.enableevents to false. I can't figure out why the size of the
shapes keeps changing, and was wondering if it had something to do with the
above code .

Am really really frustrated with this and was hoping someone out there could
help me.....thanks so much.....
 
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
killing accents sos Philippe Excel Programming 2 December 23rd 05 08:06 AM
VBA loop is killing me! Dave Bailey Excel Discussion (Misc queries) 1 October 14th 05 07:43 AM
help me out with this - it's killing me.. popovsky[_8_] Excel Programming 6 July 22nd 05 09:20 AM
killing a sub from within an if statement Cliff L Excel Programming 8 May 11th 05 02:04 PM
Killing Excel :) Nicolas Mainczyk Excel Programming 1 October 8th 03 03:57 PM


All times are GMT +1. The time now is 12:39 PM.

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"