View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default How do I print a hyperlinked document from a cell in excel

try something like this:

Option Explicit

Public Sub PrintResumes()

Dim found As Range
Dim firstAddress As String
Dim wbResume As Workbook
Set found = Range("B:B").Find(1)

If Not found Is Nothing Then

firstAddress = found.Address

Do

Set wbResume = Workbooks.Open(found.Offset(0, 1).Value)

wbResume.PrintOut

wbResume.Close False

Set found = Range("B:B").FindNext(found)

Loop Until found.Address = firstAddress

End If

End Sub


methodology: search column B for cells containing 1
If a cell is found, save its address - with FIND Excel continuously loops,
so we'll save the first one & when it loops back, we'll quit the search
So if a 1 is found, open the workbook defined in the adjoining cell in C,
print it and close it without saving, then find the next cell containing a 1
after the cell we found. check that its not the first cell already, then
open.print close and find the next

HTH


"Queenshero" wrote:

I have a list of candidates in column A and their hyperlinked resumes in
column C. When a client arrives I cause a 1 to appear in column B in each
row corresponding to the candidates that the client is schdeduled to meet .
How can I use a single command to PRINT all of the appropriate resumes for
that client (indicated by a 1 in column B)?