right

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Is it possible to tell what the right 3 characters in a
formula are

I am familiar with =Right(a1,3)

but how do I get this to work with the formula in the cell
not the value that ends up in the cell
 
builtin worksheetfunctions can't work with the formula in a cell. You would
need to write a UDF in VBA.
 
Hi Tom
though I wouldn't use the following approach (and would prefer a VBA
solution) it is possible without VBA :-)


So just for the fun of it the OP may try the following:
- lets assume you are on sheet1
- your formula is in cell A1

Try the following:
- select cell B1
- goto 'Insert - Name - Define'
- use the name 'formula' for example and as 'refert to' enter the
following formula:
=GET.CELL(6,sheet1!A1)

Now enter in cell B1:
=Right(formula,3)
 
Hi;

You can use
MyRightOfTheFormula = Right(ActiveCell.Formula, 3)

Thanks,

Greg
 
Now copy the cell with the formula and paste it on another sheet. In xl2000
and earlier, you get a message box and when clicked, a general protection
fault, excel closes and all changes are lost. I think xl2002 is more
resiliant,..
 
Hi Tom
I know :-)
this is why I wouldn't recommend this usage (sorry, forgot to add the
explanation for it). And you're right. At least Excel 2003 has no
problems with copying this formula.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top