Sub Sviluppa()
Application.ScreenUpdating = False
Dim NRec As Long, x As Long, Rec As Long
Dim Fgl(2) As String
Sheets("Risultato").Select
NRec = Range("B" & Rows.Count).End(xlUp).Row
If NRec < 2 Then NRec = 2
Range(Cells(2, 1), Cells(NRec, 3)).ClearContents
With Worksheets("User_List")
NRec = .Range("B" & Rows.Count).End(xlUp).Row
x = 1
Do While .Cells(x + 1, 2) <> ""
Fgl(1) = .Cells(x + 1, 1)
Fgl(2) = .Cells(x + 1, 2)
With Worksheets(Fgl(2))
NRec = Range("B" & Rows.Count).End(xlUp).Row + 1
Rec = .Range("A" & Rows.Count).End(xlUp).Row
Range(.Cells(2, 1), .Cells(Rec, 3)).Copy Cells(NRec, 2)
Rec = Range("B" & Rows.Count).End(xlUp).Row
Range(Cells(NRec, 1), Cells(Rec, 1)) = Fgl(1)
End With
x = x + 1
Loop
End With
Rec = Range("A" & Rows.Count).End(xlUp).Row
Range(Cells(3, 1), Cells(3, 3)).Copy
Range(Cells(3, 1), Cells(Rec, 3)).PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Application.ScreenUpdating = True
Range("A2").Select
End Sub
|