Row_Calculation

  • Thread starter Thread starter El Bee
  • Start date Start date
E

El Bee

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.
 
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)"
 

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