+ Reply to Thread
Results 1 to 4 of 4

Visual basic in excel 2010. Problem with equation programming

  1. #1
    Registered User
    Join Date
    04-13-2013
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    3

    Visual basic in excel 2010. Problem with equation programming

    This task is in sheet "5uzd"

    I found equation solution. q(3)

    I have a problem doing this task. I push the button, but in Cell(8,3) don't write real formula with numbers.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Visual basic in excel 2010. Problem with equation programming

    Quote Originally Posted by madagaskaras View Post
    ...... but in Cell(8,3) don't write real formula with numbers.
    very poor explanation
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    04-13-2013
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Visual basic in excel 2010. Problem with equation programming

    real formula should be "y=(k+5)^n1+b*k^n2+c*k" with real n1,b,n2,c numbers.
    I found how to write this "y=(k+5)^n1+b*k^n2+c*k" like text

    Edited programm.

    Private Sub CommandButton1_Click()
    Dim q(3), y(3), e(3)
    Range("a8:b100").Clear
    b = Cells(3, 2)
    c = Cells(3, 3)
    d = Cells(3, 4)
    n1 = Cells(5, 1): n2 = Cells(5, 2)
    q(1) = Cells(5, 4): q(2) = Cells(5, 5)
    y1 = 0: k = 0
    60 q(3) = (q(1) + q(2)) / 2
    For i = 1 To 3
    k = k + 1
    y(i) = (q(i) + 5) ^ n1 + b * q(i) ^ n2 + c * q(i)
    e(i) = y(i) - y1
    Cells(9 + k, 1).Value = q(i)
    Cells(9 + k, 2).Value = y(i)
    Next i
    If Sgn(e(1)) = Sgn(e(2)) Then
    Cells(8, 1).Value = "Intervale šaknies nėra": GoTo 80
    End If
    If Sgn(e(1)) = Sgn(e(3)) Then
    q(1) = q(3)
    End If
    If Sgn(e(2)) = Sgn(e(3)) Then
    q(2) = q(3)
    End If
    If Abs(y(1) - y(2)) > 0.01 Then
    GoTo 60
    End If
    Cells(8, 1).Value = "Lygties šaknis": Cells(8, 3).Value = q(3)
    Cells(9, 1).Value = "Lygtis"
    Cells(9, 2). Value = "y=(k+5)^n1+b*k^n2+c*k"
    80 '

    End Sub

  4. #4
    Registered User
    Join Date
    04-13-2013
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Visual basic in excel 2010. Problem with equation programming

    When I changed these numbers in Cells ( b = Cells(3, 2) , c = Cells(3, 3) ,d = Cells(3, 4) , n1 = Cells(5, 1): n2 = Cells(5, 2))
    I need that my formula in Cell (9,2) update new numbers

+ 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