View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Almost there with procedure error

Instead of guessing at what your code does, how about posting some test data
that's in that single column and what you want it to look like when you're done.

I'm confused about the layout that you showed in your follow up post.



StumpedAgain wrote:

I get a run-time error '424': Object required on the line:

ActiveCell.Offset(2, 0).Cut Destination:=startspot.Offset(0, 2)

in the following section. If I change the order and put the
ActiveCell.Offset(2,0).cut line down a couple lines, I get the error on the
ActiveCell.Offset(0,0).cut line leading me to believe that I'm somehow
confusing the macro. Also, it works the first time through the loop. This
error occurs the second time through the loop. Ahh!!!

ActiveCell.Offset(1, 0).Cut Destination:=startspot.Offset(0, 1)
ActiveCell.Offset(0, 0).Cut Destination:=startspot.Offset(0, 0)
ActiveCell.Offset(2, 0).Cut Destination:=startspot.Offset(0, 2) 'error
here
startspot.Offset(1, 1).Value = Right(startspot.Offset(0, 1).Value,
Len(startspot.Value) - 6)
startspot.Offset(1, 0) = Right(startspot.Offset(0, 0).Value,
Len(startspot.Value) - 6)
startspot.Value = Left(startspot.Value, 4)
startspot.Offset(0, 1).Value = Left(startspot.Offset(0, 1).Value, 4)
startspot.Offset(1, 2).Value = Right(startspot.Offset(0, 2).Value,
Len(startspot.Offset(0, 2).Value) - 7)
startspot.Offset(0, 2).Value = Left(startspot.Offset(0, 2).Value, 5)


--

Dave Peterson