title: VBA Excel how to set workbook based on partial name and check if work book is open based on partial name
body: <p>Good Afternoon,
  I never used VBA before so I really need your help!
  I have following macro (my first ever) and it works fine but after testing with our district managers  this file ("SalesOrderRMTOOL.xlsx") open with different name on their computers. 
  How can I change my macro to read only a partial name? It will always be SalesOrderRMTOOL but after it could be anything……?? Thank you for your help in advance</p>
  
  <pre><code>Private Sub CommandButton1_Click()
      Dim wsSource As Worksheet
      Dim wsTarget As Worksheet
      Dim wsTool As Worksheet
      Dim wBook As Workbook
  On Error Resume Next
      Set wBook = Workbooks("SalesOrderRMTOOL.xlsx")
      If wBook Is Nothing Then
          MsgBox "Please open SaleOrderRMTOOL file"
          Set wBook = Nothing
          Exit Sub
      End If        
      Set wsSource = Workbooks("SalesOrderRMTOOL.xlsx").Sheets("Salesorder")    
      Set wsTarget = Workbooks("RMORDERTOOL.xlsm").Sheets("Sales Order")        
      Application.ScreenUpdating = False    
      Workbooks("RMORDERTOOL.xlsm").Sheets("Tool").Range("i7:i1003").Value = ""
      Workbooks("RMORDERTOOL.xlsm").Sheets("Tool").Range("l7:l1003").Value = ""
      Workbooks("RMORDERTOOL.xlsm").Sheets("Tool").Range("o7:o1003").Value = ""
      wsTarget.Cells.Clear    
      ' Copy header row to Target sheet if target is empty
      If IsEmpty(wsTarget.Range("A1")) Then wsSource.Rows(1).Copy Destination:=wsTarget.Range("A1")    
          ' Define visible filterd cells on source worksheet and copy
          With wsSource
              .Range("A2", .Cells(.Cells(Rows.Count, "A").End(xlUp).Row, .Cells(1, Columns.Count).End(xlToLeft).Column)).SpecialCells(xlCellTypeVisible).Copy
          End With    
          ' Paste to target sheet
          wsTarget.Cells(Rows.Count, "A").End(xlUp).Offset(1).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, False
  
          Application.CutCopyMode = True
          Application.ScreenUpdating = True
  
          Workbooks("SalesOrderRMTOOL*.xlsx").Close 0
  
  End Sub
  </code></pre>