Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming Excel worksheet function
Hello all!
I need extract all parameters from my function. How I must do it? For example I have function function myfunc(byref a, b as double) as double ... end function sub fillcell ActiveCell.FormulaR1C1 = "=myfunc(10,100)" end sub When I start sub "extract" I must extract (a and b parameter from function of Activecell) sub extract() ... xA=a xB=b end sub Thanks. Stas. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming Excel worksheet function
asked elsewhere
-- Don Guillett SalesAid Software "Stas" wrote in message ... Hello all! I need extract all parameters from my function. How I must do it? For example I have function function myfunc(byref a, b as double) as double ... end function sub fillcell ActiveCell.FormulaR1C1 = "=myfunc(10,100)" end sub When I start sub "extract" I must extract (a and b parameter from function of Activecell) sub extract() ... xA=a xB=b end sub Thanks. Stas. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming Excel worksheet function
Stas,
Try something like the following: Sub Extract() Dim Pos1 As Long Dim Pos2 As Long Dim S As String Dim X1 As Variant Dim X2 As Variant S = ActiveCell.Formula Pos1 = InStr(1, S, "(") Pos2 = InStr(Pos1, S, ",") X1 = Mid(S, Pos1 + 1, Pos2 - Pos1 - 1) Pos1 = Pos2 Pos2 = InStr(Pos1, S, ")") X2 = Mid(S, Pos1 + 1, Pos2 - Pos1 - 1) Debug.Print X1, X2 End Sub This will work only if the parameters to MyFunc are simple, non-calculated values. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Stas" wrote in message ... Hello all! I need extract all parameters from my function. How I must do it? For example I have function function myfunc(byref a, b as double) as double ... end function sub fillcell ActiveCell.FormulaR1C1 = "=myfunc(10,100)" end sub When I start sub "extract" I must extract (a and b parameter from function of Activecell) sub extract() ... xA=a xB=b end sub Thanks. Stas. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Worksheet set-up/programming | Excel Worksheet Functions | |||
Posted in excel.public.programming ... Count only theformula/function find the same value ... | Excel Worksheet Functions | |||
WORKSHEET FUNCTION or PROGRAMMING. | Excel Worksheet Functions | |||
Function/Programming help with excel | Excel Discussion (Misc queries) | |||
Programming function keys in Excel | Excel Discussion (Misc queries) |