ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Recording a macro with relative reference (https://www.excelbanter.com/excel-programming/294114-recording-macro-relative-reference.html)

Shilps

Recording a macro with relative reference
 
Hi
I have a task that I have to do repeatedly and so I want to record a macro for it. Every time I have to do a conversion by multiplying the number with 3. While recording the macro , I have clicked on relative reference button and then I perfom the calculation. But the macro record
ActiveCell.FormulaR1C1 = "=8*3
where as I want that it should not record 8
Any help plz
Thank
Shilps

Bob Phillips[_6_]

Recording a macro with relative reference
 
What do you want it to do, pick up the activecell value? If so, try

Activecell.FormulaR1C1 = "=" & ActiveCell.Value & "*3"

If you want the value of the previous column, try

Activecell.FormulaR1C1 = "=RC[-1]*3"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Shilps" wrote in message
...
Hi,
I have a task that I have to do repeatedly and so I want to record a macro

for it. Every time I have to do a conversion by multiplying the number with
3. While recording the macro , I have clicked on relative reference button
and then I perfom the calculation. But the macro records
ActiveCell.FormulaR1C1 = "=8*3"
where as I want that it should not record 8.
Any help plz.
Thanks
Shilps





All times are GMT +1. The time now is 10:09 AM.

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