6

This is a really simple VBA formula but it's failing. It's only pasting into cell A6 onwards. Is it just me? Excel 2011 by the way.

Range("A4:A5").Select
Selection.Copy
Range("A6:A1000").Select
ActiveSheet.Paste
SparrwHawk
  • 13,581
  • 22
  • 61
  • 91
  • Do you mean it is only pasting into A6 and A7? I presume you are expecting it to paste (repeat) into A6 to A1000? What is in cells A4 and A5? – Alex P Sep 21 '11 at 18:22

1 Answers1

13

I think the issue is that you have two different values in A4 and A5 and so excel can only repeat those values in the paste range if the paste range is an even number of cells.

This works for me:

Range("A4:A5").Copy Destination:=Range("A6:A1001")

Note that A6:1001 is 996 cells (an even number). Using A6:A1000 is 995 and is an odd number so excel cannot work out how to repeat your values from A4 to A5.

I think this is the issue...but happy to be educated otherwise...

Alex P
  • 12,249
  • 5
  • 51
  • 70