View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default Macro to replace file name in linking formula

col = 3
NameOld = Cells(4, 1)
Do
NameNew = Cells(1, col)
Cells(2, col).Replace What:=NameOld, _
Replacement:=NameNew, LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
col = col + 1
Loop Until Cells(2, col) = ""

Hth,
Merjet