![]() |
Extract parameters passed to a function.
I hope someone can help with this. I think I am just missing a simple trick
I have created a Application_SheetBeforeDoubleClick event in which I would like my code to look at the formula in the cell being double-clicked, then extract the parameters being passed to the function. For example: Function in cell:- =Left(B1,4 I would like my code to return the parameters 'B1', and '4'. So far I am stripping off the unnecessary text to leave 'B1,4', and then using the SPLIT function to separate the parameters. This works fine for simple functions but for functions where the parameters may have commas in them themselves, this isn't going to work If anyone can help, I would me most grateful |
Extract parameters passed to a function.
After stripping off unnecessary text, replace any brackets
with double quotes, then use text to columns with double quotes as text delimiters (I'm not familiar with SPLIT function, I'm using Excel 97) In Excel 97, use Application.WorksheetFunction.Substitute function In Excel 2000 and later, use Replace function -----Original Message----- I hope someone can help with this. I think I am just missing a simple trick! I have created a Application_SheetBeforeDoubleClick event in which I would like my code to look at the formula in the cell being double-clicked, then extract the parameters being passed to the function. For example:- Function in cell:- =Left(B1,4) I would like my code to return the parameters 'B1', and '4'. So far I am stripping off the unnecessary text to leave 'B1,4', and then using the SPLIT function to separate the parameters. This works fine for simple functions but for functions where the parameters may have commas in them themselves, this isn't going to work. If anyone can help, I would me most grateful. . |
All times are GMT +1. The time now is 05:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com