title: combine Like (String Pattern) with Case in VBA
body: <p>I want to combine <code>Like</code> with <code>Case</code> in a VBA code. My current code is able to remove all sheets whose name does not match the names in range A:</p>
  
  <pre><code>Dim MyCell As Range, MyRange As Range
  Dim wbook As Workbook, xWs As Worksheet
  Dim DeleteSheetFlag As Boolean
  
  Set MyRange = Sheets("Summary").Range("A2")
  Set MyRange = Range(MyRange, MyRange.End(xlDown))
  
  Application.ScreenUpdating = False
  Application.DisplayAlerts = False
  
  Set wbook = ActiveWorkbook
  
  For Each xWs In wbook.Worksheets
      DeleteSheetFlag = True
  
      For Each MyCell In MyRange
          Select Case xWs.Name
  
              Case MyCell.Value, "Summary"
                  DeleteSheetFlag = False
                  Exit For
  
          End Select
  
      Next MyCell
  
      If DeleteSheetFlag Then
          xWs.Delete
      End If
  
  Next xWs
  
  Application.DisplayAlerts = True
  Application.ScreenUpdating = True
  </code></pre>
  
  <p>I want to change it in that way, that it removes all sheets whose name are not <strong>similar</strong> to the names in Range A. If I would be able to get something like </p>
  
  <pre><code> Case **Like** MyCell.Value, "Summary"
                  DeleteSheetFlag = False
  </code></pre>
  
  <p>the problem would be solved.
  I mean with similar the pattern match which we know from <a href="https://msdn.microsoft.com/en-us/library/te33kb6t.aspx" rel="nofollow noreferrer">Regular Expressions</a>. In my case I have for example two sheets with the names : <strong>Etat1</strong> and <strong>Etat1(2)</strong> and I want to put in <a href="https://i.stack.imgur.com/chspr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/chspr.png" alt="Range A11"></a> the string <strong>Eta</strong> in order to keep both.</p>