I am trying to extract info from multiple workbooks using the script below. The problem is that the information I need to extract is in one specific worksheet. I can't activate that worksheet when using Workbooks.Open FileNames(i).
Can someone knows how to solve?
Sub Extract()
Dim FileNames As Variant
Dim i As Integer
Application.ScreenUpdating = False
Range("C2").Select
FileNames = Application.GetOpenFilename(FileFilter:="Excel Filter (*.xlsx), *.xlsx", Title:="Open File(s)", MultiSelect:=True)
For i = 1 To UBound(FileNames)
Workbooks.Open FileNames(i)
ActiveWorkbook.Sheets("7b").Range("B2:H8").Select
Selection.Copy
Windows("All.xlsm").Activate
Selection.PasteSpecial Paste:=xlPasteAll, Transpose:=True
Workbooks.Open FileNames(i)
ActiveWorkbook.Close SaveChanges:=False
ActiveCell.Offset(1, 0).Activate
Next i
End Sub
Thank you!!!