If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Exposant
Hi all,
I have X values in Range("A2":A42") I write x^2, 1-x^2, x^3-2*x^2+12, e^x, sin(x) ... in B1 (Format: Text) and use this macro for obtain graphic : Private Sub Worksheet_Change(ByVal t As Range) Dim f As String Dim signe As String If t.Address = "$B$1" Then f = t signe = Left(f, 1) If signe = "-" Then signe = "(-1)*" f = Replace(f, "-", signe, 1, 1) End If f = Replace(f, "e", "EXP(1)") For Each c In Range("vx") v = CStr(Replace(c, ",", ".")) c.Offset(0, 1) = Evaluate(Replace(f, "x", v)) Next End If End Sub At least two problems : Wrongs answers with sin(-x^2), sin(-x^4) ... x^(2/3), x^(-3/2) ... Have you suggestions for me ? Excuce my rought english. Serge |
#2
|
|||
|
|||
Exposant
I have a solution for x^(2/3).
Good answer with (x^2)^(1/3). For sin(-x^2), sin(-x^4)... ??? Serge "garnote" a écrit dans le message de news: ... Hi all, I have X values in Range("A2":A42") I write x^2, 1-x^2, x^3-2*x^2+12, e^x, sin(x) ... in B1 (Format: Text) and use this macro for obtain graphic : Private Sub Worksheet_Change(ByVal t As Range) Dim f As String Dim signe As String If t.Address = "$B$1" Then f = t signe = Left(f, 1) If signe = "-" Then signe = "(-1)*" f = Replace(f, "-", signe, 1, 1) End If f = Replace(f, "e", "EXP(1)") For Each c In Range("vx") v = CStr(Replace(c, ",", ".")) c.Offset(0, 1) = Evaluate(Replace(f, "x", v)) Next End If End Sub At least two problems : Wrongs answers with sin(-x^2), sin(-x^4) ... x^(2/3), x^(-3/2) ... Have you suggestions for me ? Excuce my rought english. Serge |
Thread Tools | |
Display Modes | |
|
|