In that case
![]()
Sub test() Dim x As Worksheet, y As Worksheet On Error Resume Next Set x = Sheets("sheet1") Set y = Sheets("sheet2") On Error GoTo 0 Select Case True Case x Is Nothing And y Is Nothing ' do 1 Case Not x Is Nothing And Not y Is Nothing ' do 2 Case Not x Is Nothing ' do 3 Case Not y Is Nothing ' do 4 End Select End Sub
Bookmarks