Adjust VBA-Excel split code to combine similar tab names
I am using the below formula to split each excel tab into it's own workbook. The issue is I utilize Month, YTD and Full Year tabs for distribution; in my case they are broken out by name, so for example it would read "John Smith", "John Smith (2)" and "John Smith (3)" less the quotations. What I would like to do is combine each person's name onto one spreadsheet with all three tabs. I've heard that it can be done by using the first X letters, but more ideally I would like to breakout by exact matching name while excluding numbers and special characters, or if it's easier just cutting off the space and numbers after the name " (2)" and " (3)" as they are the only differences I will have (Excel will not allow for duplicate tab titles so this would have to process through VBA).
Code:
Sub Splitbook()
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
xWs.Copy
Application.ActiveWorkbook.SaveAs Filename:=xPath & "" & xWs.Name & ".xlsx"
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub