+ Reply to Thread
Results 1 to 2 of 2

VBA find end of array within cubic spline function

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    VBA find end of array within cubic spline function

    Hello,
    I am having great difficulty in getting VBA to output a continuous array (through a lastRow command). I have original data sets that vary in length and would like the automation to work its interpolation to the end of row, regardless of range. The user will also be appending data to the original set, thereby appending the array. Eventually the code would allow the array to append the data through screen update so as to not have to continually run the macro. The original code generated via macro:

    Iteration #1 (completes the interp array, but both "H" and arrays need to be capable of appending data):
    range("H2:H308").Select 
    Selection.FormulaArray = "=csplinea(R2C1:R308C1,R2C2:R308C2,R2C7:R308C7)"
    Interation #2 (does not complete the interp array from R3C7:R):
    lastRow = range("A" & Rows.Count).End(xlUp).Row 
     
    range("H2:H" & lastRow).FormulaArray = "=csplinea(R2C1:R579C1,R2C2:R579C3,R2C7:R13543C7)"
    Iteration #3 (still does not complete the interp array from R3C7:R):
    range("H2:H" & lastRow).FormulaArray = "=csplinea(R2C1:R" & lastrow & "C1,R2C2:R" & lastrow & "C3,R2C7:R" & Range("A" & lastrow)-range("A2")+1 &"C7)"
    When lastRow is used for the array, the array always stops where "C1:R" stops and doesn't continue with the series of range ("H").

    I'm completely stumped. Someone has helped me with the above iterations on Ozgrid up until now but have decided to no longer follow the thread, maybe because it is something I need to possibly hire a programmer to work on. I don't know if I am at that point yet, but any help would be greatly appreciated. I've been scratching my head at this for several weeks now and reading all the online forums for some direction. I have attached the macro wb.

    Best regards,
    Zach

  2. #2
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: VBA find end of array within cubic spline function

    The wb did not attach the first time. argh
    WorkSample1.xlsm

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. cubic spline parameters
    By dabrows in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2011, 11:21 AM
  2. cubic spline code?
    By dabrows in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2011, 01:53 PM
  3. Help with Cubic Spline Data
    By scantor in forum Excel General
    Replies: 2
    Last Post: 02-06-2009, 07:46 AM
  4. derivatives of a cubic spline
    By johnboy12 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2008, 02:49 AM
  5. Cubic Spline Interpolation
    By jomni in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2005, 02:25 AM

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