Hello Everyone,
Its been a while since my last visit. I have been working on the my VBA skills. I have a workbook with two sheets. I have written a code to append the data from one sheet to the other. But it is not working as desired. Any help or suggestion related to the issue is much appreciated.
<colgroup><col span="9"></colgroup><tbody>
</tbody>
Its been a while since my last visit. I have been working on the my VBA skills. I have a workbook with two sheets. I have written a code to append the data from one sheet to the other. But it is not working as desired. Any help or suggestion related to the issue is much appreciated.
Code:
Private Sub CommandButton1_Click()
Dim loLastRow As Long
Worksheets("Att_Entry").Range("C8:C107").Copy
With Worksheets("Template")
loLastRow = .Cells(Rows.Count, 3).End(xlUp).Row + 1
.Range("A" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
Worksheets("Att_Entry").Range("D8:D107").Copy
With Worksheets("Template")
loLastRow = .Cells(Rows.Count, 3).End(xlUp).Row + 1
.Range("B" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
Worksheets("Att_Entry").Range("E8:E107").Copy
With Worksheets("Template")
loLastRow = .Cells(Rows.Count, 3).End(xlUp).Row + 1
.Range("C" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
Worksheets("Att_Entry").Range("E3").Copy
With Worksheets("Template")
loLastRow = .Cells(Rows.Count, 3).End(xlUp).Row + 1
.Range("D" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
Worksheets("Att_Entry").Range("F8:F107").Copy
With Worksheets("Template")
loLastRow = .Cells(Rows.Count, 3).End(xlUp).Row + 1
.Range("E" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
Worksheets("Att_Entry").Range("G8:G107").Copy
With Worksheets("Template")
loLastRow = .Cells(Rows.Count, 3).End(xlUp).Row + 1
.Range("F" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
Worksheets("Att_Entry").Range("I3").Copy
With Worksheets("Template")
loLastRow = .Cells(Rows.Count, 3).End(xlUp).Row + 1
.Range("G" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
Worksheets("Att_Entry").Range("H7").Copy
With Worksheets("Template")
loLastRow = .Cells(Rows.Count, 3).End(xlUp).Row + 1
.Range("H" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
Worksheets("Att_Entry").Range("H8:H107").Copy
With Worksheets("Template")
loLastRow = .Cells(Rows.Count, 3).End(xlUp).Row + 1
.Range("I" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
MsgBox "Your Attendance Is Uploaded"
End Sub
>>This is how I want the data to be pasted | ||||||||
A ID | Emp Code | Name | Current Supervisor | Process | Role | Attendance Updated By | Date | Att |
A134307 | 889707 | Tseng Mei Fong | Ferdinand Anthony | Web Chat Lithium | TM | Abhishek Roy | 43230 | PD |
A135694 | 1275595 | Tonmoy Mitra | Web Chat Lithium | TM | Abhishek Roy | 43230 | PD | |
A127620 | 911236 | Sunit Sinha | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PD | |
A139656 | 1226133 | Sugata Chatterjee | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PD | |
A140143 | 1394819 | Sudeepta Paul | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PD | |
A130767 | 1023977 | Subhadeep Das | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PD | |
A135228 | 864579 | Soumik Mallick | Web Chat Billing 1 | Trainer | Abhishek Roy | 43230 | PD | |
A130907 | 725298 | Samrat Biswas | Web Chat Billing 1 | PC | Abhishek Roy | 43230 | PD | |
A130753 | 1023651 | Roshni Saha | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PD | |
A140142 | 1391593 | Rajbir Singh | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PD | |
A122047 | 750883 | Puja Ghosh | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PN | |
A139660 | 1392558 | Prapti Khan | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PN | |
A138581 | 1368617 | Lipika Mahanandia | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PN | |
A139094 | 1386023 | Kakoli Mandal | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PN | |
A136272 | 1311031 | I****a Bhowmick | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PN | |
A130752 | 1023608 | Ishika Mondal | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PN | |
A139659 | 1392281 | Ila Singh | Web Chat Lithium | TM | Abhishek Roy | 43230 | PN | |
A130761 | 1023820 | Dipyaman Roy | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PN | |
A401102 | 482184 | Dibyendu Chakravorty | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PN | |
A138580 | 1364106 | Biswajit Dutta | Web Chat Billing 1 | TM | Abhishek Roy | 43230 | PN | |
>>This is how its coming .. Rest of it is way at the end almost | ||||||||
A ID | Emp Code | Name | Current Supervisor | Process | Role | Attendance Updated By | Date | Att |
A134307 | 889707 | Tseng Mei Fong | ||||||
A135694 | 1275595 | Tonmoy Mitra | ||||||
A127620 | 911236 | Sunit Sinha | ||||||
A139656 | 1226133 | Sugata Chatterjee | ||||||
A140143 | 1394819 | Sudeepta Paul | ||||||
A130767 | 1023977 | Subhadeep Das | ||||||
A135228 | 864579 | Soumik Mallick | ||||||
A130907 | 725298 | Samrat Biswas | ||||||
A130753 | 1023651 | Roshni Saha | ||||||
A140142 | 1391593 | Rajbir Singh | ||||||
A122047 | 750883 | Puja Ghosh | ||||||
A139660 | 1392558 | Prapti Khan | ||||||
A138581 | 1368617 | Lipika Mahanandia | ||||||
A139094 | 1386023 | Kakoli Mandal | ||||||
A136272 | 1311031 | I****a Bhowmick | ||||||
A130752 | 1023608 | Ishika Mondal | ||||||
A139659 | 1392281 | Ila Singh | ||||||
A130761 | 1023820 | Dipyaman Roy | ||||||
A401102 | 482184 | Dibyendu Chakravorty | ||||||
A138580 | 1364106 | Biswajit Dutta | ||||||
Ferdinand Anthony | Web Chat Lithium | TM | Abhishek Roy | 43230 | PD | |||
Web Chat Lithium | TM | PD | ||||||
Web Chat Billing 1 | TM | PD | ||||||
Web Chat Billing 1 | TM | PD | ||||||
Web Chat Billing 1 | TM | PD | ||||||
Web Chat Billing 1 | TM | PD | ||||||
Web Chat Billing 1 | Trainer | PD | ||||||
Web Chat Billing 1 | PC | PD | ||||||
Web Chat Billing 1 | TM | PD | ||||||
Web Chat Billing 1 | TM | PD | ||||||
Web Chat Billing 1 | TM | PN | ||||||
Web Chat Billing 1 | TM | PN | ||||||
Web Chat Billing 1 | TM | PN | ||||||
Web Chat Billing 1 | TM | PN | ||||||
Web Chat Billing 1 | TM | PN | ||||||
Web Chat Billing 1 | TM | PN | ||||||
Web Chat Lithium | TM | PN | ||||||
Web Chat Billing 1 | TM | PN | ||||||
Web Chat Billing 1 | TM | PN | ||||||
Web Chat Billing 1 | TM | PN |
<colgroup><col span="9"></colgroup><tbody>
</tbody>
Last edited: