Move an object not using increment property
Great idea Tom, I will try that to see if I can make it work. It would sure
be nice if there was a property that you could set the location of an object
though, then i wouldn't have to select a case. Thanks again!
"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.
|