I am looking for a solution to paste data into the first empty row in specific columns.
The following function copies and pastes data properly but not in the first empty row in specific columns.
Sub Test()
Application.ScreenUpdating = False
Dim i As Integer
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To Lastrow
If Cells(i, 1).Value = "cav. 1" Then
Cells(i, 11).Offset(0, 10).Value = Cells(i, 11).Value
End If
If Cells(i, 1).Value = "cav. 2" Then
Cells(i, 11).Offset(0, 11).Value = Cells(i, 11).Value
End If
Next
Application.ScreenUpdating = True
End Sub