Conell8383
Board Regular
- Joined
- Jul 26, 2016
- Messages
- 66
Hi all. I hope you can help I have a piece of code that is producing a run time error 91
I am trying to get a MsgBox to tell me if there is a sheet in my workbook called "In Progress" or else that is not in my workbook but it is creating an error on this line
The rest of the code is below. Im sure I am not declaring something but I am at a loss as to what. Completely stumped so as always any and all help is greatly appreciated.
My code is here
CODE
I am trying to get a MsgBox to tell me if there is a sheet in my workbook called "In Progress" or else that is not in my workbook but it is creating an error on this line
Code:
If worksheet.sheet.name = "In Progress" Then
The rest of the code is below. Im sure I am not declaring something but I am at a loss as to what. Completely stumped so as always any and all help is greatly appreciated.
My code is here
CODE
Code:
Public Sub Msg_Box()
Dim wb As Workbook
Set wb = ThisWorkbook
Dim worksheet As worksheet
With wb
If worksheet.sheet.name = "In Progress" Then
MsgBox "found"
Else
MsgBox "not found"
End If
End With
End Sub