Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default using vba code to find the square root of a number

NK,

Try something like the following:

Dim N As Double
Dim P As Double
N = 27
P = N^(1/3)



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"NK" wrote in message
...
Hi

I am trying to code a formula that invloves taking the square

root of the number and for some reason the vba code won't let me
do it. I can set it up so it runs it's using the excel function
(which won't seem to call itself in teh code either) in an excel
book but I would prefer to keep it all in the code.

Any help would be appreciated.

Thanks

NK



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default using vba code to find the square root of a number

P = N^(1/3)

Of course, that should be P=N^(1/2)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Chip Pearson" wrote in message
...
NK,

Try something like the following:

Dim N As Double
Dim P As Double
N = 27
P = N^(1/3)



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"NK" wrote in message
...
Hi

I am trying to code a formula that invloves taking the square

root of the number and for some reason the vba code won't let

me
do it. I can set it up so it runs it's using the excel

function
(which won't seem to call itself in teh code either) in an

excel
book but I would prefer to keep it all in the code.

Any help would be appreciated.

Thanks

NK





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
square root marpad Excel Discussion (Misc queries) 4 March 23rd 07 08:09 PM
How do I get a (non-square) root of a given number caro_oax Excel Discussion (Misc queries) 3 November 20th 06 07:22 PM
How do I find root mean square of a periodic data in Excel Aerogel Excel Discussion (Misc queries) 0 September 7th 05 01:11 AM
using vba code to find the square root of a number Frank Kabel Excel Programming 0 August 4th 04 03:50 PM
using vba code to find the square root of a number mangesh_yadav[_37_] Excel Programming 0 August 4th 04 03:50 PM


All times are GMT +1. The time now is 06:24 PM.

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"