I am trying to add to my code where the user can select a file and then find the tab i have listed below and have it brought over into the workbook the code lives in because id put it into a button
VBA Code:
Sub Copy_Sheets()
Dim directory As String, fileName As String, sheet As Worksheet, total As Integer
Dim filePicker As FileDialog
Dim path As String
Set filePicker = Application.FileDialog(msoFileDialogFilePicker)
With filePicker
.Title = "Please select File"
.AllowMultiSelect = False
.ButtonName = "Confirm"
If .Show = -1 Then
path = .SelectedItems(1)
Else
End
End If
End With
'Dim target As ActiveWorkbook
Dim sourceWS As Worksheet
Set sourceWS = Worksheet
Dim Worksheets As Variant
ReDim Worksheets(1)
Worksheets(1) = "GatheredName"
Dim i As Variant
For i = 1 To UBound(Worksheets)
Workbooks(Source).Sheets(Worksheets(i)).Copy _
After:=Workbooks(Destination).Sheets(Workbooks(Destination).Sheets.Count)
Next i
End Sub