View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Doug Doug is offline
external usenet poster
 
Posts: 460
Default using cell value to open file

That looks great, I'll try it. Here's another issue.

The job numbers are grouped by subdivsion, so if I have job numbers in
SubDivRange1 or SubDivRange2, etc., how do I find the range name so I can
include that name in the file path with the job number?

"Joel" wrote:

Try this code. Change folder as required

Sub OpenJobFile()

Folder = "C:\temp"

JobNumber = ActiveCell.Value

FName = Dir(Folder & "\*" & JobNumber & "*.xls")

If FName = "" Then
MsgBox ("Cannot find file : " & Folder & "\*" & JobNumber & "*.xls")
Else
Workbooks.Open Filename:=Folder & "\" & FName
End If

End Sub


"ward376" wrote:

You could make them hyperlinks...

Cliff Edwards