ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Easy one: absolute cell reference in VBA (https://www.excelbanter.com/excel-programming/295135-easy-one-absolute-cell-reference-vba.html)

Paul

Easy one: absolute cell reference in VBA
 
If I want to say "value in this cell is that cell minus
the other cell", I type:

ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"

But, I want the first cell to be absolute, like $H$5.
Anybody know the syntax for that?

TIA

Paul


Chris

Easy one: absolute cell reference in VBA
 
try this Cells(5, 8)

----- Paul wrote: -----

If I want to say "value in this cell is that cell minus
the other cell", I type:

ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"

But, I want the first cell to be absolute, like $H$5.
Anybody know the syntax for that?

TIA

Paul



Vasant Nanavati

Easy one: absolute cell reference in VBA
 
ActiveCell.FormulaR1C1 = "=R5C8-RC[-2]"

--

Vasant

"Paul" wrote in message
...
If I want to say "value in this cell is that cell minus
the other cell", I type:

ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"

But, I want the first cell to be absolute, like $H$5.
Anybody know the syntax for that?

TIA

Paul




Paulw2k

Easy one: absolute cell reference in VBA
 
"=R5C8" (Row 5, Column 8)


"Paul" wrote in message
...
If I want to say "value in this cell is that cell minus
the other cell", I type:

ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"

But, I want the first cell to be absolute, like $H$5.
Anybody know the syntax for that?

TIA

Paul





All times are GMT +1. The time now is 08:39 AM.

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