pao13
Member
Hi. I would like to revise a little the following macro. When i=y (the last row in sheet "events exp up to 2 months") I would like the result to come once not twice. So duplicate rows until the last which I would like it to come up once.
Thanks for any answers!
Thanks for any answers!
Code:
Sub copy_paste_events_P_L_events_2_months()
Dim i As Long, y As Long
y = Sheets("events exp up to 2 months").Range("T" & Rows.Count).End(3).Row
For i = 9 To y
Sheets("P_L events up to 2 months").Range("B" & Rows.Count).End(3)(2).Value = Sheets("events exp up to 2 months").Range("R" & i).Value
Sheets("P_L events up to 2 months").Range("B" & Rows.Count).End(3)(2).Value = Sheets("events exp up to 2 months").Range("R" & i).Value
Sheets("P_L events up to 2 months").Range("C" & Rows.Count).End(3)(2).Value = Sheets("events exp up to 2 months").Range("S" & i).Value
Sheets("P_L events up to 2 months").Range("C" & Rows.Count).End(3)(2).Value = Sheets("events exp up to 2 months").Range("S" & i).Value
Sheets("P_L events up to 2 months").Range("D" & Rows.Count).End(3)(2).Value = Sheets("events exp up to 2 months").Range("T" & i).Value
Sheets("P_L events up to 2 months").Range("D" & Rows.Count).End(3)(2).Value = Sheets("events exp up to 2 months").Range("T" & i).Value
Next i
End Sub