J
joemeshuggah
using the following code to avoid printing restrictions on a specific set of
user ids...what is the correct way to add additional user ids (e.g. User2,
User3, etc) to the if statement?
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Application.UserName <> "User1" Then
Dim ws As Worksheet
Cancel = True
Application.EnableEvents = False
For Each ws In ActiveWindow.SelectedSheets
Select Case ws.Name
Case "Daily", "Team", "Individual": ws.PrintOut
End Select
Next ws
Application.EnableEvents = True
Else
End If
End Sub
user ids...what is the correct way to add additional user ids (e.g. User2,
User3, etc) to the if statement?
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Application.UserName <> "User1" Then
Dim ws As Worksheet
Cancel = True
Application.EnableEvents = False
For Each ws In ActiveWindow.SelectedSheets
Select Case ws.Name
Case "Daily", "Team", "Individual": ws.PrintOut
End Select
Next ws
Application.EnableEvents = True
Else
End If
End Sub