03-06-13, 09:11 #1Registered User
- 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?
03-06-13, 11:15 #2Grumpy old man (training)
Provided Answers: 10
- Join Date
- Sep 2006
- Surrey, UK
#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: 1