
Option Explicit
Sub riporta()
Dim i As Long, Nriga As Long
Dim celleA As Range
Dim VcelA As Variant
Nriga = 3
Set celleA = Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
For Each VcelA In celleA
For i = 1 To VcelA.Value
Cells(Nriga, 2) = VcelA.Value
Nriga = Nriga + 1
Next i
Next
Set celleA = Nothing
End Sub
|
Option Explicit
Sub riporta()
Dim i As Long, Nriga As Long
Dim celleA As Range
Dim VcelA As Variant, VcelD As Variant
Nriga = 3
Set celleA = Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
For Each VcelA In celleA
VcelD = Cells(VcelA.Row, 4)
For i = 1 To VcelA.Value
Cells(Nriga, 2) = VcelA.Value
Cells(Nriga, 3) = VcelD
Nriga = Nriga + 1
Next i
Next
Set celleA = Nothing
End Sub
|
Option Explicit
Sub riporta()
Dim i As Long, Nriga As Long
Dim celleA As Range
Dim VcelA As Variant, VcelD As Variant
Nriga = 3
Set celleA = Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row)
For Each VcelA In celleA
VcelD = Cells(VcelA.Row, "D")
For i = 1 To VcelA.Value
Cells(Nriga, "B") = VcelA.Value
Cells(Nriga, "C") = VcelD
Cells(Nriga, "E") = i
Nriga = Nriga + 1
Next i
Next
Set celleA = Nothing
End Sub
|
