Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Complex numbers in VBA (Excel(

would anyone know if one can use complex data type in VBA
(Excel). i know that you can do operations with comlex
numbers using Excel's Engineering formula package, but I
would prefer it if VBA was able to handle it directly.

also does it matter the version (i would prefer Excel 97,
but if not Excel 2002)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Complex numbers in VBA (Excel(

Actually you don't have to do that

sStr = Application.Run("ATPVBAEN.XLA!IMPRODUCT","3+4i","5-3i")

so to demonstrate from the immediate window:

sStr = Application.Run("ATPVBAEN.XLA!IMPRODUCT","3+4i","5-3i")
? sStr
27+11i

This assume the Analysis Toolpak - VBA has been selected in Tools=Addins.

If you create a reference to ATPVBAEN.XLA you can call it like a built in
VBA function

sStr = IMPRODUCT("3+4i","5-3i")

but to the best of my knowledge, VBA itself does not support complex
numbers.

--
Regards,
Tom Ogilvy

"levent" wrote in message
...
would anyone know if one can use complex data type in VBA
(Excel). i know that you can do operations with comlex
numbers using Excel's Engineering formula package, but I
would prefer it if VBA was able to handle it directly.

also does it matter the version (i would prefer Excel 97,
but if not Excel 2002)




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Complex numbers in VBA (Excel(

that is quite helpful, thanks

-----Original Message-----
Actually you don't have to do that

sStr = Application.Run("ATPVBAEN.XLA!IMPRODUCT","3+4i","5-

3i")

so to demonstrate from the immediate window:

sStr = Application.Run("ATPVBAEN.XLA!IMPRODUCT","3+4i","5-

3i")
? sStr
27+11i

This assume the Analysis Toolpak - VBA has been selected

in Tools=Addins.

If you create a reference to ATPVBAEN.XLA you can call it

like a built in
VBA function

sStr = IMPRODUCT("3+4i","5-3i")

but to the best of my knowledge, VBA itself does not

support complex
numbers.

--
Regards,
Tom Ogilvy

"levent" wrote in

message
...
would anyone know if one can use complex data type in

VBA
(Excel). i know that you can do operations with comlex
numbers using Excel's Engineering formula package, but I
would prefer it if VBA was able to handle it directly.

also does it matter the version (i would prefer Excel

97,
but if not Excel 2002)




.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i write complex numbers inside excel cels? STINGER Excel Discussion (Misc queries) 3 October 21st 07 06:44 PM
import complex numbers to excel wabodie Excel Worksheet Functions 0 September 9th 06 07:31 PM
How do I set up Excel to handle complex (& imaginary) numbers? Peter Thompson Excel Worksheet Functions 2 September 1st 06 02:58 PM
Does Office 2000 Excel support complex numbers at all? Paul Ciszek Setting up and Configuration of Excel 1 February 28th 06 10:22 PM
VBA complex numbers Levent Excel Programming 1 July 22nd 04 03:46 PM


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

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

About Us

"It's about Microsoft Excel"