I'm trying to write a UDF that calculates the slope between 2 variable ranges. But it stucks when I declare the ranges
Whats wrong with this?
Thanks!![]()
Please Login or Register to view this content.
I'm trying to write a UDF that calculates the slope between 2 variable ranges. But it stucks when I declare the ranges
Whats wrong with this?
Thanks!![]()
Please Login or Register to view this content.
Because you want rang1 and rang2 to be object/range variables, I believe you need to use the Set statement to assign them (note that only rang2 is dimensioned as a range, rang1 is dimensioned as a variant).
If this were my UDF, I'd try to pass the desired ranges to the function through the argument list.
Originally Posted by shg
Just the rang2 = ret.Range(Cells(uLinha2 - 20, a), Cells(uLinha2, a)) is not working... i don't understand why
Try this.
![]()
Please Login or Register to view this content.
If posting code please use code tags, see here.
you should really make that function volatile if you don't follow MrShorty's advice (which would be better!)
Josie
if at first you don't succeed try doing it the way your wife told you to
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks