Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello.
    I have some code that should do the following:

    Range("H2:R2").Select
    Selection.Copy
    Range("H3:R" & I).Select
    ' where I is a variable with a large number, 16772
    ActiveSheet.Paste

    The last line causes the error 'Selection is too large'. I have debugged to ensure that the ActiveSheet is correct and the correct range H2:R16772 is selected.
    Any idea what might cause this error?
    Thanks for any assistance, Andy.

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    [quote name='andrewgibsonsw' post='767358' date='25-Mar-2009 20:49']Any idea what might cause this error?[/quote]
    I don't know what causes the error, but the following code works fine.
    Code:
      i = 16772
      With ActiveWorkbook.ActiveSheet
    	.Range("H2:R2").Copy Destination:=.Range("H2:R" & i)
      End With

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •