Page 1 of 1

vba copy data

Posted: Sat Oct 10, 2020 11:32 pm
by sna
here are what the existing code do. 1. when i click the remove button it will ask me the asset number , 2. I type the asset number that i wanted to remove and paste it on the sheet2. - but here I just wanted to have few data , like the asset #, item description type and date it was remove and JOb order number to pasted on the sheet 2.
I wish just to copy a portion of the rows and also include the date where I extract it and assign a Job order .

I have already the code, and perfectly working. as you can see on the attached sheet, My concern is I once I click the remove button and type the asset tag that I want to remove on sheet 1 to transfer to sheet 2, once I run the code all data in row transfer.



Best wishes,

Re: vba copy data

Posted: Sun Oct 11, 2020 8:23 am
by snasui
:D The example code as below:

Code: Select all

'Other code
''========== Copy to another Sheet==
Dim Lr As Long
Lr = Sheet2.Range("B9999").End(xlUp).Row
With Sheet1.Range("B12:L" & Range("A" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeVisible) '.Copy
    Sheet2.Range("B" & Lr + 1).Resize(1, 3).Value = .Resize(1, 3).Value
    Sheet2.Range("B" & Lr + 1).Offset(0, 3).Value = .Cells(1, 6).Value
End With

'==========Delete Entire Row====
'Other code