I have been looking around websites and forums for a solution to combining all open workbooks into single worksheets and really struggling here as I'm completely new to VB.
I found the following code that combines all open workbooks sheet1 into one workbook as separate tabs which is great but does not achieve what I need it to do. I have tried to modify and failed.
Can anyone help with this as I'm really struggling.
I found the following code that combines all open workbooks sheet1 into one workbook as separate tabs which is great but does not achieve what I need it to do. I have tried to modify and failed.
Can anyone help with this as I'm really struggling.
Code:
Sub CombinedWorksheetsFromOpenWorkbook()
Dim Wkb As Workbook
Dim sWksName As String
sWksName = "Sheet1"
For Each Wkb In Workbooks
If Wkb.Name <> ThisWorkbook.Name Then
Wkb.Worksheets(sWksName).Copy _
Before:=ThisWorkbook.Sheets(1)
End If
Next
Set Wkb = Nothing
End Sub