ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Do not know to how reference another sheet in my formual - embarrasingly simple I hope (https://www.excelbanter.com/excel-programming/342393-do-not-know-how-reference-another-sheet-my-formual-embarrasingly-simple-i-hope.html)

Curious[_5_]

Do not know to how reference another sheet in my formual - embarrasingly simple I hope
 
Here is the snippet of code I am working with:

Worksheets("basedata").Range("D7").Activate
col = 0
Do While ActiveCell.Offset(0, col) < ""
row = 2
Do While ActiveCell.Offset(row, col - 1) < ""
ActiveCell.Offset(row, col).FormulaR1C1 =
"=basedata1!RC*1.08"
row = row + 1
Loop
col = col + 1
Loop

As you can see I have hard coded a value of 1.08 whereas I would like to set
that value in the General sheet at D2. How do I fix the
formula above to reference the General sheet at location D2.

I have tried ActiveCell.Offset(row, col).FormulaR1C1 =
"=basedata1!RC*General!D2" but that did not work.



Tom Ogilvy

Do not know to how reference another sheet in my formual - embarrasingly simple I hope
 
ActiveCell.Offset(row, col).FormulaR1C1 =
"=basedata1!RC*General!R2C4"

--
Regards,
Tom Ogilvy


"Curious" wrote in message
m...
Here is the snippet of code I am working with:

Worksheets("basedata").Range("D7").Activate
col = 0
Do While ActiveCell.Offset(0, col) < ""
row = 2
Do While ActiveCell.Offset(row, col - 1) < ""
ActiveCell.Offset(row, col).FormulaR1C1 =
"=basedata1!RC*1.08"
row = row + 1
Loop
col = col + 1
Loop

As you can see I have hard coded a value of 1.08 whereas I would like to

set
that value in the General sheet at D2. How do I fix the
formula above to reference the General sheet at location D2.

I have tried ActiveCell.Offset(row, col).FormulaR1C1 =
"=basedata1!RC*General!D2" but that did not work.





Curious[_5_]

Do not know to how reference another sheet in my formual - embarrasingly simple I hope
 
Thanks. You nailed it but I think you already knew that. :-)

"Tom Ogilvy" wrote in message
...
ActiveCell.Offset(row, col).FormulaR1C1 =
"=basedata1!RC*General!R2C4"

--
Regards,
Tom Ogilvy


"Curious" wrote in message
m...
Here is the snippet of code I am working with:

Worksheets("basedata").Range("D7").Activate
col = 0
Do While ActiveCell.Offset(0, col) < ""
row = 2
Do While ActiveCell.Offset(row, col - 1) < ""
ActiveCell.Offset(row, col).FormulaR1C1 =
"=basedata1!RC*1.08"
row = row + 1
Loop
col = col + 1
Loop

As you can see I have hard coded a value of 1.08 whereas I would like to

set
that value in the General sheet at D2. How do I fix the
formula above to reference the General sheet at location D2.

I have tried ActiveCell.Offset(row, col).FormulaR1C1 =
"=basedata1!RC*General!D2" but that did not work.








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

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