View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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