LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Move an object not using increment property

Sub PostitionObject(obj as Shape, lLeft as Long, lTop as Long, lFlip as
Long)
obj.ShapeRange.IncrementLeft lLeft
obj.shapeRange.IncrementTop lTop
if lFlip = 1 or lFlip = 0 then
obj.ShapeRange.Flip lFlip
End if
End Sub

so pass anything but a 1 or 0 and it won't flip.

You could make it an optional argument, but it seems to me it would be just
as easy to pass a -1 or something like that.

--
Regards,
Tom Ogilvy


"JCanyoneer" wrote in message
...
Tom, Do you know what value I would use if I did not want the object to

flip?
I have tried a 0 and a 1 but can't seem to get consistent results.

"Tom Ogilvy" wrote:

You could write a subroutine

Select Case Range("D114").Value
Case 3
PositionObject ActiveSheet.Shapes("Vise"), -270, -111,

msoFlipHorizontal
Case 4
PositionObject ActiveSheet.Shapes("Vise"), -189, 0, msoFlipHorizontal
End Select

End Sub



Sub PostitionObject(obj as Shape, lLeft as Long, lTop as Long, lFlip as
Long)
obj.ShapeRange.IncrementLeft lLeft
obj.shapeRange.IncrementTop lTop
obj.ShapeRange.Flip lFlip
End Sub

--
Regards,
Tom Ogilvy



"JCanyoneer" wrote in message
...
I am setting up an excel sheet that will locate certain drawing

objects
based
on check boxes or radio buttions. Right now I have a lot of code that

checks
the current location of the object and then uses the IncrementLeft and
IncrementTop properties to move the object. Does anyone know a

different
way
to do this. I would like to just locate the object at a point based on

the
radio button or check box rather that having to check where it

currently
is
and adjusting the IncrementLeft and IncrementTop properties. Here is

the
code
for one of the objects I am currently using:

If Range("D114").Value = 3 Then
ActiveSheet.Shapes("Vise").Select
Selection.ShapeRange.IncrementLeft -270
Selection.ShapeRange.IncrementTop -111
Selection.ShapeRange.Flip msoFlipHorizontal
Else
If Range("D114").Value = 2 Then
ActiveSheet.Shapes("Vise").Select
Selection.ShapeRange.IncrementLeft -189
Selection.ShapeRange.Flip msoFlipHorizontal
End If
End If

This is an object with only to location possibilities. This expression

grows
larger exponentially with location possibilities and I would like to

have
one
simple expression for each location.

Thank you in advance for any help you can give me.






 
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
How do I access to property of chart object ? HP. Jung Charts and Charting in Excel 0 April 11th 07 02:36 PM
How to check if an object has a certain property? J Excel Programming 1 December 5th 04 11:58 AM
Page Object property Matt[_18_] Excel Programming 1 October 2nd 03 01:43 PM
Object doesn't support this property or method Rick Campbell Excel Programming 2 July 13th 03 11:53 PM


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