View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Type mismatch error

Drop the S from that first Dim line:
Dim Piece As Shapes
should be
Dim Piece As Shape '<-- no trailing S on Shape

But there are lots of shapes that you can't move. You may want to be more
specific with your coding.

Ron de Bruin has lots of info he
http://www.rondebruin.nl/controlsobjectsworksheet.htm




Jive wrote:

Hi I am getting a type mismatch error back on line 2 of the script below. I
have already made a workaround but this is a much neater way of getting the
code to work if i can. I lack understanding of this method and have only
applied it in a couple cases before now so any help would be much appreciated.

Dim Piece As Shapes
For Each Piece In ActiveSheet.Shapes
CurrentTop = Piece.Top
CurrentLeft = Piecee.Left
Piece.Top = 540 - CurrentTop
Piece.Left = 540 - CurrentLeft
Next Piece


--

Dave Peterson