Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I occasionally mke user-defined functions in VBA. I am trying to write a
function using the LOG10() function and the FIXED() function and I get an error for both of these functions - - unlike when I use other canned functions. Are there limitations to the functions I can use in a user-defined function? LOG() works, so I can work around the LOG10() function. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
If you're trying to use the LOG10() function inside of a VBA module, well,
there ain't no such animal. Static Function Log10(X) Log10 = Log(X) / Log(10#) End Function There's some workaround code that will give you LOG10() using Log() (which is available in VBA). Similarly, there is no FIXED() in VBA - that's also a worksheet only function. Closest thing in VBA is probably FIX(n) where n is a number, and FIX(n) returns the integer portion of n. "CH" wrote: I occasionally mke user-defined functions in VBA. I am trying to write a function using the LOG10() function and the FIXED() function and I get an error for both of these functions - - unlike when I use other canned functions. Are there limitations to the functions I can use in a user-defined function? LOG() works, so I can work around the LOG10() function. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
LOG10 and FIXED are not VBA functions. Use Application.Worksheetfunction.LOG10 if you have to.
-- Kind regards, Niek Otten Microsoft MVP - Excel "CH" wrote in message ... |I occasionally mke user-defined functions in VBA. I am trying to write a | function using the LOG10() function and the FIXED() function and I get an | error for both of these functions - - unlike when I use other canned | functions. Are there limitations to the functions I can use in a | user-defined function? LOG() works, so I can work around the LOG10() | function. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
...using the LOG10() function and the FIXED() function and I get an
error for both of these functions Sub Demo() Debug.Print WorksheetFunction.Log10(100) Debug.Print WorksheetFunction.Fixed(1 / 7, 2) ' or... With WorksheetFunction Debug.Print .Log10(100) Debug.Print .Fixed(1 / 7, 2) End With End Sub -- HTH :) Dana DeLouis Windows XP & Office 2003 "CH" wrote in message ... I occasionally mke user-defined functions in VBA. I am trying to write a function using the LOG10() function and the FIXED() function and I get an error for both of these functions - - unlike when I use other canned functions. Are there limitations to the functions I can use in a user-defined function? LOG() works, so I can work around the LOG10() function. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
please see Neik's answer. You need write the full path reference when you use
worksheetfunction. Obviously, You lost key word "Application." before "WorksheetFunction.Log10(100)" "Dana DeLouis" wrote: ...using the LOG10() function and the FIXED() function and I get an error for both of these functions Sub Demo() Debug.Print WorksheetFunction.Log10(100) Debug.Print WorksheetFunction.Fixed(1 / 7, 2) ' or... With WorksheetFunction Debug.Print .Log10(100) Debug.Print .Fixed(1 / 7, 2) End With End Sub -- HTH :) Dana DeLouis Windows XP & Office 2003 "CH" wrote in message ... I occasionally mke user-defined functions in VBA. I am trying to write a function using the LOG10() function and the FIXED() function and I get an error for both of these functions - - unlike when I use other canned functions. Are there limitations to the functions I can use in a user-defined function? LOG() works, so I can work around the LOG10() function. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
problem with user defined function | Excel Discussion (Misc queries) | |||
User defined charts | Charts and Charting in Excel | |||
Format a cell with numbers and user defined text | Excel Discussion (Misc queries) | |||
Excel user defined functions. | Excel Worksheet Functions | |||
User defined charts- font size too small | Charts and Charting in Excel |