A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Exposant



 
 
Thread Tools Display Modes
  #1  
Old September 16th, 2003, 08:45 PM
garnote
external usenet poster
 
Posts: n/a
Default 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  
Old September 16th, 2003, 08:57 PM
garnote
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:46 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.