简体   繁体   中英

reference a cell from another worksheet using a variable

I'm trying to refer to another worksheet (BASE tab) in the same workbook. I run the code below inside a couple of loops where x and y increment based on certain conditions. I've messed around with the code but I haven't had any luck. This is what I have so far but it does not work.

Cells(i, j) = "='BASE tab'!R[" & x & "]C[ & y & ]"

I want cells(i,j) to reference the other cells so I don't have to run my lengthy macro for minor value changes.

 Cells(i, j) = "='BASE tab'!R[" & x & "]C[" & y & "]"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM