#1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default right

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default right

builtin worksheetfunctions can't work with the formula in a cell. You would
need to write a UDF in VBA.

--
Regards,
Tom Ogilvy

wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default right

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)

--
Regards
Frank Kabel
Frankfurt, Germany

"Tom Ogilvy" schrieb im Newsbeitrag
...
builtin worksheetfunctions can't work with the formula in a cell. You

would
need to write a UDF in VBA.

--
Regards,
Tom Ogilvy

wrote in message
...
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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default right

Hi;

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

Thanks,

Greg
-----Original Message-----
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
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default right

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,..

--
Regards,
Tom Ogilvy

"Frank Kabel" wrote in message
...
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)

--
Regards
Frank Kabel
Frankfurt, Germany

"Tom Ogilvy" schrieb im Newsbeitrag
...
builtin worksheetfunctions can't work with the formula in a cell. You

would
need to write a UDF in VBA.

--
Regards,
Tom Ogilvy

wrote in message
...
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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default right

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.

--
Regards
Frank Kabel
Frankfurt, Germany

"Tom Ogilvy" schrieb im Newsbeitrag
...
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,..

--
Regards,
Tom Ogilvy

"Frank Kabel" wrote in message
...
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)

--
Regards
Frank Kabel
Frankfurt, Germany

"Tom Ogilvy" schrieb im Newsbeitrag
...
builtin worksheetfunctions can't work with the formula in a cell.

You
would
need to write a UDF in VBA.

--
Regards,
Tom Ogilvy

wrote in message
...
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






  #7   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default right

Thank You




-----Original Message-----
Hi;

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

Thanks,

Greg
-----Original Message-----
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
.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"