Formula in VBasic

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

Guest

Hello,

I have following problem; with help of a macro I want to copy a formula in
different cells. The formula is
ActiveCell.FormulaR1C1 = "=MATCH(RC[-21],Comments!C[-21],FALSE)"
The formula starts in cell V22 and finds the Vlookup value in cell A22. When
I copy the formula down, the row number will be adjusted. But when I copy
same formula to cell W22, it refers to value B22. How can I fix the formula
in Vbasic, to look at always the same column and only adjust the row numbers?

thanks in advance for your help!

regards
SB
 
Is this what you want?

ActiveCell.FormulaR1C1 = "=MATCH(RC1,Comments!C1,FALSE)"
 
Hi Bob,

yes, thanks! That was really simple, but exactly what I needed ;-)

regards
SB

Bob Phillips said:
Is this what you want?

ActiveCell.FormulaR1C1 = "=MATCH(RC1,Comments!C1,FALSE)"


--
HTH

Bob Phillips

SB said:
Hello,

I have following problem; with help of a macro I want to copy a formula in
different cells. The formula is
ActiveCell.FormulaR1C1 = "=MATCH(RC[-21],Comments!C[-21],FALSE)"
The formula starts in cell V22 and finds the Vlookup value in cell A22. When
I copy the formula down, the row number will be adjusted. But when I copy
same formula to cell W22, it refers to value B22. How can I fix the formula
in Vbasic, to look at always the same column and only adjust the row numbers?

thanks in advance for your help!

regards
SB
 
Pleasure mate.

--
HTH

Bob Phillips

SB said:
Hi Bob,

yes, thanks! That was really simple, but exactly what I needed ;-)

regards
SB

Bob Phillips said:
Is this what you want?

ActiveCell.FormulaR1C1 = "=MATCH(RC1,Comments!C1,FALSE)"


--
HTH

Bob Phillips

SB said:
Hello,

I have following problem; with help of a macro I want to copy a formula in
different cells. The formula is
ActiveCell.FormulaR1C1 = "=MATCH(RC[-21],Comments!C[-21],FALSE)"
The formula starts in cell V22 and finds the Vlookup value in cell
A22.
When
I copy the formula down, the row number will be adjusted. But when I copy
same formula to cell W22, it refers to value B22. How can I fix the formula
in Vbasic, to look at always the same column and only adjust the row numbers?

thanks in advance for your help!

regards
SB
 

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