How do I have VBA return the trendline types possible for given d.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Excel VBA program which applies each trendline type to data then
chooses the option with the best R^2 value. How can I have the program skip
unavailable options? For instance when I make the data very strange Power and
Exponential regressions are not available. This causes my macro to crash.
 
Options are grayed out when you have negative numbers... depending on the
type of regression you are doing.
 
Tom has already given you how to deal with your problem. At the same
time, using R-squared is not necessarily the best way to approach the
problem. A polynomial of power 6 will have a R-squared greater than a
polynomial of power 2 (or a linear fit). However, that doesn't
automatically make it a better fit. A linear or 2nd order polynomial
may be more appropriate for describing the data.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top