View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.links
[email protected] peterjohansson.sthlm@gmail.com is offline
external usenet poster
 
Posts: 5
Default Dynamic link to workbook

On 20 Okt, 01:18, Bill Manville wrote:
Through the UI, just copy an entire row (say for art 11111 to the
bottom of your summary table then select the new row and Edit / Replace
/ 11111 / with: 11134 / Replace All.

If you wanted to use a macro, you could detect a change in column 1 of
the worksheet and copy the row above, and then do the replace, as
above. Something like this, in the worksheet's module

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Cells.Count = 1 And Not
IsEmpty(Target) And Target.Row 1 Then
' copy down the formulas from the row above
With Target.Offset(, 1).Resize(, Columns.Count - 1)
.FillDown
.Replace Target.Offset(-1).Value, Target.Value, xlPart
End With
End If
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup


-----------------------------------------------------------------

Thanks Bill, workes like a charm + a very clean script!!!

I run into a new problem that I'm hoping you also could help me with.
Prior I've used a script (se bellow) to find and list files in a
specified directory. Now, I want to look into a URL insted of a
folder. I've tried by changing the line;
..LookIn = "F:\"
to
..LookIn = "URL;http..."
but this doesn't work

Do you have any idea on how to make this work?

Best regards
/Peter

---------------------------------------------------------------
Dim pathWanted As String
With Application.FileSearch
.NewSearch
.LookIn = "F:\"
.SearchSubFolders = True
.MatchTextExactly = False
.FileType = msoFileTypeAllFiles
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
Cells(i, 1).Value = .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
---------------------------------------------------------------