ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Row_Calculation (https://www.excelbanter.com/excel-worksheet-functions/186926-row_calculation.html)

El Bee

Row_Calculation
 
I have a for a formula in a macro:
ActiveCell.FormulaR1C1 = _
"=MID(R[-11]C,FIND("","",R[-11]C,1)+2,10) & "" "" &
MID(R[-11]C,FIND(""D_"",R[-11]C,1)+2,FIND("","",R[-11]C,1)-FIND(""D_"",R[-11]C,1)-2)"

I need to replace the "-11" with a variable name that I calculate prior to
this.

Can I do this? If so, I need your help.

I still trying to understand macros.

thanks for looking.

El Bee.


Adilson Soledade

Row_Calculation
 
You could do this:

Var = -11
ActiveCell.FormulaR1C1 = _
"=MID(R[-" & Var & "]C,FIND("","",R[-" & Var & "]C,1)+2,10) & "" ""
&
MID(R[-" & Var & "]C,FIND(""D_"",R[-" & Var & "]C,1)+2,FIND("","",R[-" & Var
& "]C,1)-FIND(""D_"",R[-" & Var & "]C,1)-2)"

--
Adilson Soledade


"El Bee" wrote:

I have a for a formula in a macro:
ActiveCell.FormulaR1C1 = _
"=MID(R[-11]C,FIND("","",R[-11]C,1)+2,10) & "" "" &
MID(R[-11]C,FIND(""D_"",R[-11]C,1)+2,FIND("","",R[-11]C,1)-FIND(""D_"",R[-11]C,1)-2)"

I need to replace the "-11" with a variable name that I calculate prior to
this.

Can I do this? If so, I need your help.

I still trying to understand macros.

thanks for looking.

El Bee.



All times are GMT +1. The time now is 12:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com