Well, spotted, thanks

On Thursday, 6 March 2014 13:37:10 UTC+2, Paul Schreiner wrote:

> The problem seemt to be:
>  
> in LinInterpolate, xRange and yRange are declared as "variant"
> when you pass xRange as Range("B3:B44").Value,
> you're passing an ARRAY, so xRange becomes an Array variable.
>  
> an Array variable doesn't HAVE the property of: xRange.Cells.Count
> because xRange (as an Array) doesn't HAVE "Cells".
>  
> You have to pass the data as a Range.
>  
> as in:
> Cl_Array(1) = LinInterpolate(60, Sheets("AIRFOIL_DATA").Range("B3:B44"), 
> Sheets("AIRFOIL_DATA").Range("C3:C44"))
>  
> (leaving off the .Value)
>  
> However, that's going to cause you a problem with:
> Cells(45, 5) = LinInterpolate(70000, Cl_Array, Cl_Array)
>  
> I think you're going to have to either:
> Rewrite LinInterpolate to operate on Arrays,
> or create a second version that uses Arrays instead of Ranges.
>  
> *Paul*
> -----------------------------------------
>
>
>
>
>
>
>
> *“Do all the good you can,By all the means you can,In all the ways you 
> can,In all the places you can,At all the times you can,To all the people 
> you can,As long as ever you can.” - John Wesley*
> -----------------------------------------
>
>    *From:* Gerrit Grundling <totallyp...@gmail.com <javascript:>>
> *To:* excel-...@googlegroups.com <javascript:> 
> *Sent:* Thursday, March 6, 2014 2:32 AM
> *Subject:* $$Excel-Macros$$ Re: "Two-dimensional" interpolation
>  
> Slowly but surely I'm getting there. Thanks for the help so far.
>  
> I am including an Excel file with the airfoil data, function 
> "LinInterpolate" and functions "Floor" and "Ceiling". None of these are my 
> own, as I found them on the interweb.
>  
> I have commented out my attempt at automating the linear interpolation 
> process, although I suspect it actually works after all of the above. 
> However, I am now getting "error 424: Object required" It seems the arrays 
> don't enter "LinInterpolate".
>
> On Monday, 3 March 2014 21:21:45 UTC+2, Rajan Verma wrote:
>
> Hi 
>
> make your array as "double" data type not "Long"
>
> Thanks
> Rajan.
>
>
>
>
> n Wednesday, 26 February 2014 07:07:45 UTC-7, Gerrit
>  Grundling  wrote:
>
> Greetings, all
>  
> I have attached some aerofoil data for a Clark Y foil. This data is also 
> available in my spread sheet.
>  
> The Reynolds number is given in the heading as 
> 5.00E+04, 1.00E+05, 5.00E+05,  1.00E+06 and 3.00E+06. I need to find Cl and 
> Cd at an AoA for a Reynolds number:
>  
> GetCl(AoA, Re)
> GetCd(AoA, RE)
>  
> Interpolation functions are easy enough to find. 
> Here<http://www.vbaexpress.com/forum/showthread.php?41522-Linear-Interpolation&p=263514&viewfull=1#post263514>is
>  one that also includes sorting. But I need to run this over the 
> "two-dimensional" array that is the aerofoil data. Not all aerofoil AoA's 
> are the same for the different Re (xfoil was used to obtain this data). 
> This means that creating an array would have blanks at some AoA's, unless I 
> interpolate to fill in the gaps.
>  
> I was thinking that I might write a code to create an array of cl and cd 
> for each Re-number at the AoA, but the AoA is not always a neat number. 
> However, neither is the Reynolds number.
>  
> How would you do it? Could you use an interpolation function such as the 
> one I linked to (not a preference, so I'm impartial)?
>  
> Thanks in advance
>  
>  
>
> -- 
> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
> https://www.facebook.com/discussexcel
>  
> FORUM RULES
>  
> 1) Use concise, accurate thread titles. Poor thread titles, like Please 
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice 
> will not get quick attention or may not be answered.
> 2) Don't post a question in the thread of another member.
> 3) Don't post questions regarding breaking or bypassing any security 
> measure.
> 4) Acknowledge the responses you receive, good or bad.
> 5) Jobs posting is not allowed.
> 6) Sharing copyrighted material and their links is not allowed.
>  
> NOTE : Don't ever post confidential data in a workbook. Forum owners and 
> members are not responsible for any loss.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "MS EXCEL AND VBA MACROS" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to excel-macros...@googlegroups.com <javascript:>.
> To post to this group, send email to excel-...@googlegroups.com<javascript:>
> .
> Visit this group at http://groups.google.com/group/excel-macros.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>  

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to