|
-
Jun 11th, 2003, 11:16 AM
#1
Thread Starter
New Member
Excel 2000 VBA math functions
While I have been a programmer for quite a while, I am a novice to Excel VBA and VB in general.
I need to use both log to the base 10 [Log ... mathematics notation] and the natural log [Ln]. Excel has Ln, LOG10, and LOG(n,b). Unfortunately, I only find Log in the VBA math library. Even weider the VBA Log function appears to actually be the natural log rather than common log.
Can someone explain if what I have seen is strange or standard. Are there Log10, Log(n,b) and Ln function in a VBA library?
-
Jun 11th, 2003, 09:31 PM
#2
Fanatic Member
The Log that you see is the standard VB Log function. To use the Excel worksheet functions, you must use Application.WorksheetFunction. Example:
VB Code:
'Uses Excel worksheet function.
MsgBox Application.WorksheetFunction.Log(86)
'Uses VB Log function.
MsgBox Log(86)
-
Jun 12th, 2003, 12:11 AM
#3
Thread Starter
New Member
Thanks for the assist. I had not found the application method.
-
Jun 14th, 2003, 01:09 AM
#4
Lively Member
Excel VBA math functions
On an Excel spreadsheet, I entered:
=LOG(10) and got 1
=LOG(100) and got 2
=LN(10) and got 2.302585
So, both base 10 and natural logarithms are available in my Excel 97.
-
Jun 25th, 2003, 10:12 PM
#5
Lively Member
I have no idea how my name got on the previous reply, which was made PRIOR to my intent, by some other person! I thought I had posted something like:
To get the base 10 logarithm of a number, since it is equal to the natural logarithm of the number, divided by the natural logarithmod 10, use this, for y = log10(x):
y = ln(x)/ln(10) which, in BASIC, QuickBASIC, VB and VBA is:
y = log(x)/log(10)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|