1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
Sub Copiare()
Dim DerLig_F1 As Long
Dim f1, f2
Application.ScreenUpdating = False
Set f1 = Sheets("Foglio2")
Set f2 = Sheets("Foglio3")
f2.Cells.Clear
DerLig_F1 = f1.[A10000].End(xlUp).Row
f1.Range(Cells(1, "A"), Cells(DerLig_F1, "C")).Copy Destination:=f2.Cells(1, "A")
Matr = Cells(1, "A")
For i = 2 To DerLig_F1
If f2.Cells(i, "A") = Matr Then
f2.Cells(i, "A") = ""
Else
Matr = Cells(i, "A")
End If
Next
f2.Select
For i = 1 To DerLig_F1
If Cells(i, "A") <> "" Then
Matr = Cells(i, "A")
Rows(i).Insert Shift:=xlDown
Cells(i, "B") = Matr
With Cells(i, "B").Font
.Name = "Calibri"
.Size = 11
.Color = -16776961
End With
i = i + 1
End If
Next
Columns(1).Delete
End Sub |
Partager