I have the following code that hyperlinks the file to a cell in excel when you type in the filename. I need to alter this code and not sure how. I need for the code that when you type in file name it also finds the filename in subfolders also. Right now it only does the top level folder, i need to check the top level folder and all subfolders for the file. Also to have it search for any extension, not just a .doc file. Also so you're aware the files that are being hyperlinked are on a server. 

Code:
<code class="language-vb">Private Sub Worksheet_Change(ByVal Target As Range) </code>
<code class="language-vb">'change "c:\tmp\" to whatever reference you need </code>
<code class="language-vb">'a cell, a public variable, a fixed string </code>
<code class="language-vb">If Target.Column = 16 Then </code>
<code class="language-vb">MakeHyperLink Target, "C:\Temp" </code>
<code class="language-vb">End If </code>
<code class="language-vb">End Sub </code>
<code class="language-vb"></code>
<code class="language-vb">Public Function MakeHyperLink(InRange As Range, _ </code>
<code class="language-vb">ToFolder As String, _ </code>
<code class="language-vb">Optional InSheet As Worksheet, _ </code>
<code class="language-vb">Optional WithExt As String = "doc") As String </code>
<code class="language-vb">Dim rng As Range </code>
<code class="language-vb">Dim Filename As String </code>
<code class="language-vb">Dim Ext As String </code>
<code class="language-vb"></code>
<code class="language-vb">'check to see if folder has trailing \ </code>
<code class="language-vb">If Right(ToFolder, 1) <> "\" Then </code>
<code class="language-vb">Filename = ToFolder & "\" </code>
<code class="language-vb">Else </code>
<code class="language-vb">Filename = ToFolder </code>
<code class="language-vb">End If </code>
<code class="language-vb">'check to see if need ext </code>
<code class="language-vb">If WithExt <> "" Then </code>
<code class="language-vb">'check to see if ext has leading dot </code>
<code class="language-vb">If Left(WithExt, 1) <> "." Then </code>
<code class="language-vb">WithExt = "." & WithExt </code>
<code class="language-vb">End If </code>
<code class="language-vb">End If </code>
<code class="language-vb">
'if not explicit sheet then assign active </code>
<code class="language-vb">If InSheet Is Nothing Then </code>
<code class="language-vb">Set InSheet = ActiveSheet </code>
<code class="language-vb">End If </code>
<code class="language-vb">
'now for every cell in range </code>
<code class="language-vb">For Each rng In InRange </code>
<code class="language-vb">
'does range have value </code>
<code class="language-vb">If rng <> "" Then </code>
<code class="language-vb">
'make hyperlink to file </code>
<code class="language-vb">InSheet.Hyperlinks.Add Anchor:=rng, Address:= _ </code>
<code class="language-vb">Filename & rng.Text & WithExt, TextToDisplay:=rng.Text </code>
<code class="language-vb">End If </code>
<code class="language-vb"></code>
<code class="language-vb">Next </code>
<code class="language-vb"></code>
<code class="language-vb">End Function </code>