Problem inserting cut range

L

Luke

I'm trying to cut a range then insert the cut range at a particular location.
The code looks like this:

Range("F5:G" & ActiveSheet.UsedRange.Rows.Count).Cut
Range("D5").Insert(xlShiftToRight)

However, when it reaches this point, I get an error saying "Cut method of
Range class failed". I've tried changing the destination range so that it
reads similar to the origin range, but that didn't help. Can someone help me
get the syntax on this line correct? I've got several similar lines further
down in the code. If I can fix this line, I'll be able to fix them all.

Thanks.
 
R

Ryan H

Post the rest of your code so we can help you. That snipet of code worked
for me.
 
L

Luke

I'll have to get it on Monday (Feb 8) since the code's on my machine at work.
I copy/pasted the code from my machine to here, however, so it doesn't look
exactly like it did in the editor. The code is actually all one line, with a
space between "Cut" and the second "Range". If it still works for you as one
line, I'll post the entire code (that I have so far) on Monday.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top