+ Reply to Thread
Results 1 to 3 of 3

Passing Spreadsheet Ranges to VBA LINEST function

  1. #1
    Registered User
    Join Date
    03-09-2011
    Location
    Birmingham, Alabama USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Passing Spreadsheet Ranges to VBA LINEST function

    I am writing a VBA function which will take X and Y curve points and determine their polynomial trendline coefficients. I don't want to create an Excel chart to obtain the coefficients.

    Eventually I'd like to let the user select a set of X and Y points on a spreadsheet, pass them to the VBA function and return different values back to the spreadsheet.

    J-Walk & Associates webpage provides equations for calculating the trendline coefficients. Unforturnately, I can't get the function to work.

    Here is the primary code which is causing the problem.
    Please Login or Register  to view this content.
    When I run the code above I get the error "Type mismatch". I tried converting the xFlow and yTDH values to an array but with no success.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,960

    Re: Passing Spreadsheet Ranges to VBA LINEST function

    Post a workbook with some data so we can step through the code.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    03-09-2011
    Location
    Birmingham, Alabama USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Passing Spreadsheet Ranges to VBA LINEST function

    I believe I did attach the file "Excel Trendlines Test.xlsm". It appears on the webpage when I view the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1