+ Reply to Thread
Results 1 to 2 of 2

Help populating cells from vba script.

  1. #1
    Registered User
    Join Date
    11-23-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    1

    Help populating cells from vba script.

    Hi,

    I was trying to "convert" this matlab *.m file that I have to excel vba but just don't have enough knowledge to do so in regard.

    What i'm trying to do here is to plot a value of x against time.
    Please Login or Register  to view this content.

    vba attempt:
    Please Login or Register  to view this content.
    And then when the cells are populated by the values of x I would plot them against, say b1:b78, which would be time t+t, to get my graph.

    ANY help would be appreciated.

    Thanks.

  2. #2
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Help populating cells from vba script.

    For i = 2 To 78
    x(i + 1) = (a * x(i - 1) - (b / (t * t)) * x(i - 1) + x(i) + t * x(i)) / (b / (t * t) + c / t)
    Next i
    Cells(1, 1).Value = x()
    What this is doing, is calculating this value for i 2 to 78, then placing the value in cell 1 1 after it's all over.
    Try this
    For i = 2 To 78
    x(i + 1) = (a * x(i - 1) - (b / (t * t)) * x(i - 1) + x(i) + t * x(i)) / (b / (t * t) + c / t)
    cells( i, 1).value = x
    Next i
    I't adding in a line which increases the row referenced which has the value entered as i increases from 2 to 78.
    Last edited by mewingkitty; 11-23-2010 at 10:13 PM.
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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