Option Explicit Sub unisci() Dim Ur, x, Rg, Msg Ur = Range("A" & Rows.Count).End(xlUp).Row Columns("D:F").Clear Rg = 2 For x = 4 To Ur Cells(Rg, 4) = "": Rg = Rg + 1 Cells(Rg, 4) = "": Rg = Rg + 1 Cells(Rg, 4) = "": Cells(Rg, 5) = Cells(x, 1): Cells(Rg, 6) = "": Rg = Rg + 1 Cells(Rg, 4) = "": Cells(Rg, 5) = Cells(x, 2): Cells(Rg, 6) = "": Rg = Rg + 1 Next Cells(Rg, 4) = "": Rg = Rg + 1 Cells(Rg, 4) = "": Rg = Rg + 1 Cells(Rg, 4) = "4.12.12": Rg = Rg + 1 Cells(Rg, 4) = "": Rg = Rg + 1 Cells(Rg, 4) = "" Ur = Range("D" & Rows.Count).End(xlUp).Row For x = 2 To Ur Msg = Msg & Cells(x, 4) & Cells(x, 5) & Cells(x, 6) Next Cells(1, 4) = Msg MsgBox "Fatto" End Sub
Sub unisci_2() Dim Ur, x, Rg, Msg Ur = Range("A" & Rows.Count).End(xlUp).Row Columns("D:F").Clear Rg = 2 Cells(Rg, 4) = "": Rg = Rg + 1 For x = 4 To Ur Cells(Rg, 4) = "": Rg = Rg + 1 Cells(Rg, 4) = "": Cells(Rg, 5) = Cells(x, 1): Cells(Rg, 6) = "": Rg = Rg + 1 Cells(Rg, 4) = "": Cells(Rg, 5) = Cells(x, 2): Cells(Rg, 6) = "": Rg = Rg + 1 Cells(Rg, 4) = "": Rg = Rg + 1 Next Cells(Rg, 4) = "": Rg = Rg + 1 Cells(Rg, 4) = "4.12.12": Rg = Rg + 1 Cells(Rg, 4) = "": Rg = Rg + 1 Cells(Rg, 4) = "" Ur = Range("D" & Rows.Count).End(xlUp).Row For x = 2 To Ur Msg = Msg & Cells(x, 4) & Cells(x, 5) & Cells(x, 6) Next Cells(1, 4) = Msg MsgBox "Fatto" End Sub