Pat_The_Bat
Board Regular
- Joined
- Jul 12, 2018
- Messages
- 83
Trying to put a snip of code at the beginning of an Add-In I've created that will check to make sure the required worksheet exists before it tries to run the code (to avoid error).
Below is not working. Any direction/guidance is appreciated.
Below is not working. Any direction/guidance is appreciated.
HTML:
Dim sht As WorksheetDim wb As Workbook
If wb Is Nothing Then Set wb = ActiveWorkbook
On Error Resume NextSet sht = wb.Sheets(Table)If worksheetExists = sht ThenMsgBox ("The Sheet Table Exists. Click Ok to Format the UW Approval")
GoTo FormatApprovalElse
MsgBox ("This Add-In will only run if there is a worksheet tab titled 'TABLE'")Exit Sub
End If