View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
PhilosophersSage PhilosophersSage is offline
external usenet poster
 
Posts: 55
Default Copy and Paste link between workbooks

Still cannot figure out search and compare function but was able to figure
out copy link function. Just cannnot get the varables to work. I tried adding
a varable to the code but then it would not work. any pointers on search and
varable help is much appreciate, thank you!

Windows("source data.xlsm").Activate
Range("H266").Select 'would like to change to Range("H"&RowVar1)
Selection.Copy
Windows("Destination data.xlsx").Activate
Range("N45").Select 'would like to change to Range("N"&RowVar2)
ActiveSheet.Paste Link:=True
Windows("source data.xlsm").Activate
Range("J266").Select 'would like to change to Range("H"&RowVar1)
Application.CutCopyMode = False
Selection.Copy
Windows("Destination data.xlsx").Activate
Range("O45").Select' would like to change to Range("N"&RowVar2)
ActiveSheet.Paste Link:=True
Windows("source data.xlsm").Activate
Range("K266").Select 'would like to change to Range("H"&RowVar1)
Application.CutCopyMode = False
Selection.Copy
Windows("Destination data.xlsx").Activate
Range("P45").Select 'would like to change to Range("N"&RowVar2)
ActiveSheet.Paste Link:=True


"PhilosophersSage" wrote:

I have several workbooks, source data (SD) and destination data (DD) which
are portions of SD, I would like to make a macro that would search for
matching values between SD column L & DD column B and if there is a match
copy a link from SD column H, J & K to DD column N, O & P this way I can
reduce entry points for data.

The big problem I have is the search between workbooks, also I cannot get
the paste function to give a link between workbooks. Any help or pointers
anyone can give me I would really appreciate it! Thank you!