Results 1 to 7 of 7

Trouble Using Last Row in VBA Formula

Threaded View

  1. #1
    Registered User
    Join Date
    11-27-2012
    Location
    France
    MS-Off Ver
    Excel 2007
    Posts
    65

    Trouble Using Last Row in VBA Formula

    Hi,

    I am calculating probability density function for a set of data which is arranged over 55 rows in a column. The equation is working if I refer the absolute row positions in the formula, however it is not working if I try making it dynamic, by defining a last row. The data is from row 2 to 56. The mean and standard deviation values are placed at row number 58 and 59, so to calculate the probability function I need to refer the row number 58 and 59 in the formula. The trouble is I have to modify the formula everytime the number of data changes, sometimes 100 rows of data or sometimes 20 rows of data.

    How can I make it dynamic? Can you tell me a way to modify the NORMDIST formula to integrate the last row function? Anyone?

    Here is the code:
    LastRow = Cells(Rows.Count, "A").End(xlUp).Row
    NextRw = LastRow + 1
    Cells(2, "B").Select
    ActiveCell.Formula = "=NORMDIST(RC[-1], R58C[-1], R59C[-1], False)"
    ActiveCell.Select
    Selection.AutoFill Destination:=Range("B2:B" & NextRw), Type:=xlFillDefault
    It'd help me alot! Thanks in advance.
    Sanjeev
    Last edited by sanjeevpandey; 03-12-2013 at 11:43 AM.

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