ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using cell contents ae address (https://www.excelbanter.com/excel-programming/291425-using-cell-contents-ae-address.html)

Roger[_8_]

Using cell contents ae address
 
I have 2 colums that contain a value in the first column
and an address in the cells of the second column. The
address is in R1C1 format. I want to write VB/excel macro
that reads the contents of the address cell, goes to that
address and pastes the associated value in the new cell.
How do I do this?

Tom Ogilvy

Using cell contents ae address
 
Assume data to be copie is in column a and R1C1 formatted addresses are
strings in Column B (rows 1 to 200)
for each cell in Range("B1:B200")
sVal = cell.Text
cell.FormulaR1C1 = "=" & sVal
set rng = cell.DirectDependents
rng.value = cell.offset(0,-1).Value
cell.Value = sVal
Next

--
Regards,
Tom Ogilvy


"Roger" wrote in message
...
I have 2 colums that contain a value in the first column
and an address in the cells of the second column. The
address is in R1C1 format. I want to write VB/excel macro
that reads the contents of the address cell, goes to that
address and pastes the associated value in the new cell.
How do I do this?





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

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