Andy David Clarke
New Member
- Joined
- Jun 14, 2007
- Messages
- 12
I'm tring to write a macro that will analyse a formula from a cell in Excel.
If the cell I'm looking at it is =SUMIF(Sheet1!A:A,A3,Sheet1!B:B), I want to analyse this formula:
if doesn't contains SUMIF then exit sub
then return variables for:
The Sheet I'm looking at (Sheet1)
The item I'm looking at (A3).
If I could get at the actual formula, I could cut it up as required:
between = & ( is the function
between ( & ! is the sheet
between , & , is the item I'm looking at
But I'm struggling to find a way to actually analyse the formula as VBA seems to want to look at the result or the formula itself rather than how it is built up. I've tried cell.formula, but can't make this work.
Any help would be much appreciated as I've never really used VBA to look at this before, so am struggling...
If the cell I'm looking at it is =SUMIF(Sheet1!A:A,A3,Sheet1!B:B), I want to analyse this formula:
if doesn't contains SUMIF then exit sub
then return variables for:
The Sheet I'm looking at (Sheet1)
The item I'm looking at (A3).
If I could get at the actual formula, I could cut it up as required:
between = & ( is the function
between ( & ! is the sheet
between , & , is the item I'm looking at
But I'm struggling to find a way to actually analyse the formula as VBA seems to want to look at the result or the formula itself rather than how it is built up. I've tried cell.formula, but can't make this work.
Any help would be much appreciated as I've never really used VBA to look at this before, so am struggling...