Strange Range copying

  • Thread starter David Macdonald
  • Start date
D

David Macdonald

This copies the range once:
Sheets("Sheet1").Range("B3:p3").Copy Sheets("Sheet3").Rows(8)

This copies the range repeatedly to the end of the row:
Sheets("Sheet1").Range("B3:Q3").Copy Sheets("Sheet3").Rows(8)

Why? Is there a limit of 15 columns?
 
D

Dave Peterson

First, I can't think a time where not specifying the entire range that I want
pasted is a good idea.
If I want it pasted just a single time, I'd use:
Sheets("Sheet1").Range("B3:p3").Copy Sheets("Sheet3").Range("A8")
or multiple times:
Sheets("Sheet1").Range("B3:p3").Copy Sheets("Sheet3").Range("a9:ad9")

=======
I don't think it's a limit in the number of columns. I think it's excel trying
to help.

Since B3:q3 is 16 columns and 16 is an integer divisor into the number of
columns that xl2003 has (256), excel says: I know you want to fill the entire
row--since you told me to!

But B3:p3 is only 15 columns and 15 is not an integer divisor into 256, excel
says: Well, I can't fill the row exactly, so I'll just do one.

If you change your ranges to be 2 columns and 3 columns, you'll see the same
thing happen.
 

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