I need to have a macro print a file, but only after the
workbook has been activated 5 times.
1. By file, do you mean all sheets?
2. By activated, do you mean opened?
You could use code in the This Workbook module, eg:
Private Sub Workbook_Open()
Range("Sheet1!A1") = Range("Sheet1!A1") + 1
If Range("Sheet1!A1") = 5 Then
ActiveWorkbook.PrintOut Copies:=1, Collate:=True
Range("Sheet1!A1") = 0
End If
ActiveWorkbook.Save
End Sub
To access the module, right-click the icon left of File in the menu bar,
choose View Code. But ...
3. Anyone could skip this by disabling macros on opening the file. So
possibly the only way if you *have* to have it is to password-protect the
file, then users would *have* to ask you to open it & you'd know which Nth
opening it was.
Rgds,
Andy