Unfortunately that didn't make any difference. Clicking in or hitting enter over A2 produces nothing?
No error messages, just nowt.
Am running Win 7, x64 by the way.
My Work Sheets folder is "C:\Work Sheets"
If this was working correctly I assume that all the .pdf files would show up in Cell A4 as hyperlinks?
My macro now reads as below. Any other ideas?
Sub ListPics()
Dim lCount As Long, ws1 As Worksheet, f As Range, rng As Range
Set ws1 = Worksheets("Find")
Set f = ws1.Range("A2")
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
On Error Resume Next
Range("A5:A65536").Clear
With Application.FileSearch
.NewSearch
.LookIn = "C:\Work Sheets\" 'change this
.Filename = ".pdf"
If .Execute > 0 Then
For lCount = 1 To .FoundFiles.Count
If InStr(.FoundFiles(lCount), f) > 0 Then
ActiveSheet.Hyperlinks.Add Anchor:=Range("A65536").End(xlUp).Offset(1, 0), Address:=.FoundFiles(lCount), TextToDisplay:=Replace(.FoundFiles(lCount), "M:\CA\jobs\", "")
End If
Next lCount
End If
End With
rng.Font.Size = 28
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.EnableEvents = True
End Sub
Bookmarks