LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Moving shapes

For your "right" and "left" cases... do you really want to add the "Height"
property of the .TopLeftCell.Offset(-i) cell, or did you want to be using
the Width property instead?

--
Rick (MVP - Excel)


"Evil Red Smurf" wrote in message ...
The shape is supposed to move around a specified path in a series of steps
the size of which are decided by a different set of code (That bit works
fine). The part of the code that I'm struggling with instructs the shape
to change direction when it reaches specific points. What I've done is,
throughout the movement operation there is a word in A1, and depending on
what that word is changes the dirrection setting of the shape. The
movement works brililantly until it reaches 1 corner and the shape should
then move in a downwards direction. The code I have for that at the
moment is:

With ActiveSheet.Shapes("RedDot")
For i = 1 and d*16
Select Case Range("A1")
Case "down"
.Top = .Top + .TopLeftCell.Offset(-i).Height
DoEvents
WAIT
checkposred
Case "right"
.Left = .Left + .TopLeftCell.Offset(-i).Height
DoEvents
WAIT
checkposred
Case "up"
.Top = .Top - .TopLeftCell.Offset(i).Height
DoEvents
WAIT
checkposred
Case "left"
.Left = .Left - .TopLeftCell.Offset(i).Height
DoEvents
WAIT
checkposred
End Select
Next
End With

Apologies for the hand-written code, I'm new to this and I can't see how
to add the code any other way.

Many thanks

Evil Red Smurf



Peter T wrote:

With the limited amount of information given, and the hand written
15-Dec-09

With the limited amount of information given, and the hand written code
snippet, can only guess maybe the row of the topleftcell is less than 1+i

Regards,
Peter T

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Create Multiple Dynamic ASP.NET Datagrids
http://www.eggheadcafe.com/tutorials...dynamic-a.aspx




 
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
Moving Shapes Preschool Mike Excel Discussion (Misc queries) 3 April 16th 10 10:45 PM
Moving shapes around - XL2007 bug? Mike Excel Programming 1 April 14th 09 05:45 PM
inserted shapes keep moving Stephid707 Excel Discussion (Misc queries) 1 February 16th 09 05:37 PM
Moving Shapes within VBA Juan Schwartz Excel Programming 3 August 20th 07 09:12 PM
Moving shapes with the mouse NickHK Excel Programming 1 August 14th 06 11:30 AM


All times are GMT +1. The time now is 06:32 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"