PDA

View Full Version : Transfer the values from one sheet to another by adding them to below of previous row



arya96
06-29-2020, 02:51 AM
Hi everyone,
I am working on a stock traking system. I have 2 sheets one of them is include all order information and other one include multiple order infotmation. I tried to copy all filled row between A and I column in multiple order sheet and paste them to the first sheet which is include all order information with a help of a button (button is in a form) but the main problem is everytime the user click the button the code needs to scan all rows and start printing from the empty line. I added my failed code on the below.
sipkalem= multiple order sheet
sayfa4= all order information


Dim lR As Integer
lR = Worksheets("sipkalem").Cells(Rows.count, 1).End(xlUp).Row

For l = 2 To lR
For i = 1 To 9
If Worksheets("sipkalem").Cells(l, 4).Value <> "" Then
With Sheets("Sayfa4")
l = .Range("A65536").End(3).Row + 1
If Worksheets("Sayfa4").Cells(l, i).Value = "" Then
Worksheets("Sayfa4").Cells(l, i).Value = Worksheets("sipkalem").Cells(l, i).Value
End If
End With
End If
Next
Next l
Sheets("sipkalem").Range("A2:L30").ClearContents


Thanks for your help

SamT
06-30-2020, 08:27 AM
With Worksheets("sipkalem").Range(Cells(2, "A"). Cells(Rows.Count, "A").End(xlUp).Offset(, 8)
If .Cells(4).Value <> "" Then
.Copy Sheets("Sayfa4").Cells(Rows.Count, "A").End(xlUp).Offset(1)
End If
.ClearContents
End With


With the entire table
IF Cell # 4 is Empty
Copy the entire table to the first empty Row(s) in the other sheet
Clear Contents of the entire table