ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cell reference using macro (https://www.excelbanter.com/excel-programming/340130-cell-reference-using-macro.html)

Alex Martinez

cell reference using macro
 

Hi,

I am using Excel 2002 and I want to do a macro that will cell reference
from one worksheet to another. For example I want Sheet 1 cell B10:C17 to
be able to reference from Sheet 2 F10:G17. I don't want to do a copy and
paste, because the user may change the data in Sheet 2. Any tips or
suggestion will be appreciated. Thank you in advance.




David Adamson[_4_]

cell reference using macro
 
Not too sure what you are trying to do but this will create a range
reference for both ranges.
It really depends what you want to do with the data.

Dim rng1 as range
Dim rng2 as range

With worksheets("Sheet1")
set rng1 = .range("b10:c17")
End with

With worksheets("Sheet2")
set rng2 = .range("F10:G17")
End with




"Alex Martinez" wrote in message
...

Hi,

I am using Excel 2002 and I want to do a macro that will cell reference
from one worksheet to another. For example I want Sheet 1 cell B10:C17 to
be able to reference from Sheet 2 F10:G17. I don't want to do a copy and
paste, because the user may change the data in Sheet 2. Any tips or
suggestion will be appreciated. Thank you in advance.





Norman Jones

cell reference using macro
 
Hi Alex,

Try:

Sub Tester()

Sheets("Sheet1").Range("B10:C17").FormulaR1C1 = _
"=Sheet2!RC[4]"
End Sub


---
Regards,
Norman



"Alex Martinez" wrote in message
...

Hi,

I am using Excel 2002 and I want to do a macro that will cell reference
from one worksheet to another. For example I want Sheet 1 cell B10:C17 to
be able to reference from Sheet 2 F10:G17. I don't want to do a copy and
paste, because the user may change the data in Sheet 2. Any tips or
suggestion will be appreciated. Thank you in advance.






All times are GMT +1. The time now is 02:40 PM.

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