Re: Print Hyperlinked File, Move To Next
Are the applications referenced by the hyperlinks from a separate Excel workbook, or are they from another application altogether (e.g., TEXT, HTML, etc.)?
If we're talking about other Excel workbooks being hyperlinked, this should work (but beware of auto-open macros). The code should begin with the sheet that has the hyperlinks selected.
Sub FollowHyperLinksAndPrintAndClose() Dim MyWrkBk$ Dim MySht$ MyWrkBk = ThisWorkbook.Name MySht = ActiveSheet.Name On Error Resume Next ' just in case there are problems Application.DisplayAlerts = False Application.ScreenUpdating = False ' select first cell with hyperlink Range("C5").Select ' if no value is in cell checked, end loop Do Until ActiveCell.Value = "" Windows(MyWrkBk).Activate Sheets(MySht).Select Selection.Hyperlinks(1).Follow ' if hyperlink was followed and we're not still looking at this workbook If ActiveWorkbook.Name <> MyWrkBk Then ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True ActiveWindow.Close End If ' select next cell down and do again ActiveCell.Offset(1, 0).Range("A1").Select Loop Application.DisplayAlerts = True Application.ScreenUpdating = True End Sub