I am new to the forum and this is my very first post - Please be kind. I do not have a VBA technical background and have created my macros out of necessity. Here is my current issue. I have a spreadsheet with macro print buttons for each persons section of the spreadsheet. This is a monthly report and sometimes a person will not have any data. When you click on the macro button, it gives an error since the named range is not available. I have tried to use OnError GoTo, and keep having issues. What I would like to do is for those that do not have a range to get a message "No Exceptions", but when they do have data, the section prints as usual.
Here is my orignal code - I would like to somehow have it opt out with a message box for those times when there is no data for that person - Thanks in advance for the help!!!
Sub Print017()
Application.ScreenUpdating = False
Sheets("All Exceptions by Officer").Activate
Range("Officer_017").Select
ActiveSheet.PageSetup.PrintArea = "Officer_017"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWorkbook.Worksheets("Report Printing").Select
End Sub
Bookmarks