Hi ricdamiani,
Did you check the file i sent ? anyways pasting here
Private Sub Workbook_Click()
Dim wbMaster As Workbook
Dim ws As Worksheet
Dim desws As Worksheet
Dim NextRow As Long
Dim Fpath As String
Dim Fname As String
Dim strName As String
Dim j As Long
j = 2
Set wbMaster = Workbooks("Goal.xlsm")
Set desws = Worksheets("Sheet1")
Fpath = "C:\Users\Username\Desktop\forum\" ' change to your directory
Fname = Dir(Fpath & "2*.xls")
Application.ScreenUpdating = False
Do While Fname <> ""
'strName = Left(InStr(Fname, ".") - 1)
strName = Left(Fname, InStr(Fname, "."))
With Workbooks.Open(Fpath & Fname)
For Each ws In .Sheets(Array("Sheet1"))
For i = 0 To 100
re = Array("C3", "C5", "C8", "D8", "E8", "D9", "G13", "H13", "F22", "F24", "F26", "F29", "F31", "F34", "F40", "D43", "E43", "F46", "D49", "E49", "F52", "F55", "C58", "C59", "C60", "C61", "C62", "")
rng = re(i)
If rng = "" Then Exit For
desws.Cells(j, i + 2) = ws.Range(rng).Value
desws.Cells(j, 1) = strName
Next i
j = j + 1
Next ws
.Close SaveChanges:=False
End With
Fname = Dir
Loop
Application.ScreenUpdating = True
End Sub
Bookmarks