@YA_10963798 wrote:
That was helpful. However I used the same function on other sheet and it works perfectly. why it does not work in the new function ;]
In your 'other sheet' "z" and also "ztips" sure were vectors and not ranges. Otherwise the "last" function would again throw that error.
You can test if its vector by writing IsArray(z)= . If the result looks like a vector full of zeros, then its a range. If the result is just the number 1, its a vector.
Or you could try to access/evaluate the element #ORIGIN, If you don't get an error, its a vector.

BTW, its not a good idea and not good habit to change the value of ORIGIN in the midst of a worksheet as you have done.
I would suggest to create vectors right from the start if possible. But if for some reason you have to turn a range into a vector, you may use one of the utility functions which were posted here in the forum in various threads.
A very basic one is

Don't forget to label "rows" as being a "Function" as unfortunately you also have defined a numeric variable with the name "rows" in your sheet.
Then you could write something like

and z.tips will be a genuine vector.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.


