Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: pasting a variant to a named range that has larger dimensions

    i created a range test that is 4 cols and 4 rows. I then filed a range of 3 col and 3 rows and set all values to "A". I wanted to copy the 3x3 array to the range test that is a 4x4 array
    my code is copying the data but being the 4th row and 4th column all cells = #N/A what can i do so that if copying from a smaller array to a larger range this doenst happen or best way to resolve if it does?

  2. #2
    weejas is offline Grumpy old man (training)
    Join Date
    Sep 2006
    Surrey, UK
    Provided Answers: 18
    #N/A means "not available", which is correct in this situation. Because the paste operation had fewer values in the source range than the destination range, the excess destination cells had no available data for them.

    You could test the source and destination ranges first, to see if they match in size in shape. If not, you could display an error message to the user.

    If you want another value to go into the excess destination cells, you will first have to work out how to find the excess cells, and then what value to go into them.
    10% of magic is knowing something that no-one else does. The rest is misdirection.
    Beers earned: 2

Posting Permissions

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