ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Index / match type formula copying formulas, not values (https://www.excelbanter.com/excel-programming/285847-vba-index-match-type-formula-copying-formulas-not-values.html)

Kuba

VBA Index / match type formula copying formulas, not values
 
Simplyfying my problem an awful lot, I am trying to write a macro that
would take a certain table, look up the vertical code and horizontal
code of certain items, copy a link from those items, change it to
absolute refernce (which part I know how to do) then go to another
table, and paste the link to the appropriate cell (with the same
vertical and horizontal code-cooridinates), then change it back to
relative reference (which again I know how to do).

I know how to do the first part, but this is also only using INDEX /
MATCH, so returning a value, not an actual link.

I have been browsing my VBA books and the groups for quite a long time
trying to find a solution - to no avail.

I would greatly appreciate any help

Kuba

Tom Ogilvy

VBA Index / match type formula copying formulas, not values
 
It is unclear what the problem is. If you want to reference a value in Cell
B9, you put in a formula

set rng = Worksheets("Sheet1").Range("B9")
worksheets("Sheet2").Range("F32").Formula = "=" & rng.Address(0,0,,True)

I suspect you have two tables with the same row and column labels, but
perhaps in different order on each table - and you want to fill out table 2
with links back to the appropriate row and column intersection on table 1.
Is that what you want?

--
Regards,
Tom Ogilvy


"Kuba" wrote in message
om...
Simplyfying my problem an awful lot, I am trying to write a macro that
would take a certain table, look up the vertical code and horizontal
code of certain items, copy a link from those items, change it to
absolute refernce (which part I know how to do) then go to another
table, and paste the link to the appropriate cell (with the same
vertical and horizontal code-cooridinates), then change it back to
relative reference (which again I know how to do).

I know how to do the first part, but this is also only using INDEX /
MATCH, so returning a value, not an actual link.

I have been browsing my VBA books and the groups for quite a long time
trying to find a solution - to no avail.

I would greatly appreciate any help

Kuba




Kuba[_2_]

VBA Index / match type formula copying formulas, not values
 
Yes, I have two tables with almost the same row and column labels, which may be in different order. It is an input sheet for a financial model, which is connected to numerous sources. What I am after is not to link the new sheet to the old sheet, but to copy the formulas (i.e. links) of the old sheet into the respective places of the new sheet




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

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