Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Complex Numbers
How do I do complex numbers in Visual Basic for Excel. I
installed the analysis add in so I can now do it in Excel. However, I want Visual Basic to manipulate complex numbers in my program. This is part of my basic code that doesn't work. Thanks for the help. wks_W.Range("AY" & i).Value = WorksheetFunction.complex (1, 2) or wks_W.Range("AY" & i).Value = complex(1, 2) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Complex Numbers
Here are two ways.
In the vba editor, if you do "Not" have the following checked... Tools|References... and a check on "atpvbaen.xls" then here is one way that I use: Sub Demo1() Dim x Const ImAbs As String = "ATPVBAEN.XLA!ImAbs" x = Run("ImABS", "3+4i") End Sub However, if you do select "atpvbaen.xls", then it's much easier: Sub Demo2() Dim x x = ImAbs("3+4i") 'or your example: Range("A1") = Complex(1, 2) End Sub HTH Dana DeLouis wrote in message ... How do I do complex numbers in Visual Basic for Excel. I installed the analysis add in so I can now do it in Excel. However, I want Visual Basic to manipulate complex numbers in my program. This is part of my basic code that doesn't work. Thanks for the help. wks_W.Range("AY" & i).Value = WorksheetFunction.complex (1, 2) or wks_W.Range("AY" & i).Value = complex(1, 2) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I format complex numbers ? | Excel Discussion (Misc queries) | |||
Operating on Complex Numbers | Excel Discussion (Misc queries) | |||
VBA: Calculating Complex Numbers | Excel Discussion (Misc queries) | |||
Round-down complex numbers | Excel Discussion (Misc queries) | |||
Complex numbers | Excel Programming |