Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA complex numbers

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
...
Hello

I was just wondering if there is a data type called
complex (i.e. for operations with complex numbers) in any
version of VBA for Excel.

I am aware that you can use Excel functions for this, but
I was wondering if VBA can deal with it also.

because if i use the Excel functions in VBA. i have to do

Range("something").formula = "IMPRODUCT(whatever)"

and have to read that again back into VBA

somevariable = Range("something")
(if anyone can think of a more efficient way, that would
also do)




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 do I format complex numbers ? ks Excel Discussion (Misc queries) 5 April 5th 23 01:14 PM
Operating on Complex Numbers Charles Excel Discussion (Misc queries) 3 May 24th 10 10:50 PM
VBA: Calculating Complex Numbers LenS Excel Discussion (Misc queries) 0 January 8th 07 05:24 PM
Complex Numbers No Name Excel Programming 1 June 24th 04 06:04 AM
Complex numbers Alain Turgeon Excel Programming 2 June 1st 04 09:19 PM


All times are GMT +1. The time now is 09:19 AM.

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

About Us

"It's about Microsoft Excel"