Hi, made mistake in VBA code. I need that copy all rows from one sheet to another, but copy just last row. Please, advice me where I made mistake.
Sub LastRowInOneColumn()
Dim LastRow As Long
Dim i As Long, j As Long
'Find the last used row in a Column: column A in this example
With Worksheets("Suskirstymas")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
MsgBox (LastRow)
'first row number where you need to paste values in Sheet1'
With Worksheets("Pasiulymas")
j = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
End With
For i = 1 To LastRow
With Worksheets("Suskirstymas")
If .Cells(i, 1).Value = "T" Then
.Rows(i).Copy
Worksheets("Pasiulymas").Range("A" & j).PasteSpecial Paste:=xlPasteValues
End If
End With
Next i
End Sub
Sub LastRowInOneColumn()
Dim LastRow As Long
Dim i As Long, j As Long
'Find the last used row in a Column: column A in this example
With Worksheets("Suskirstymas")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
MsgBox (LastRow)
'first row number where you need to paste values in Sheet1'
With Worksheets("Pasiulymas")
j = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
End With
For i = 1 To LastRow
With Worksheets("Suskirstymas")
If .Cells(i, 1).Value = "T" Then
.Rows(i).Copy
Worksheets("Pasiulymas").Range("A" & j).PasteSpecial Paste:=xlPasteValues
End If
End With
Next i
End Sub