Hi Guys.
I want to copy the last row with data and paste in the last empty row using macro but I am finding it difficult.
This is what I have been trying since but it is not working.
Sub test()
Dim ws As Worksheet
Set source = Sheets("Total")
Dim LC As Long
With ThisWorkbook.Sheets("Total")
LC = Cells(1, Columns.Count).End(xlToLeft).Column
Columns(LC).Copy
Cells(1, LC + 1).PasteSpecial Paste:=xlPasteValues
End With
End Sub
My data looks like this:
A B
[TABLE="width: 447"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]
[/TD]
[TD]West[/TD]
[TD="align: right"]58[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]East[/TD]
[TD="align: right"]68[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]North[/TD]
[TD="align: right"]4[/TD]
[/TR]
</tbody>[/TABLE]
Secondly, I want it to be creating a sheet, insert timestamp as the sheet's name and then paste my data in the sheet each time I run it.
Thank you all in advance
I want to copy the last row with data and paste in the last empty row using macro but I am finding it difficult.
This is what I have been trying since but it is not working.
Sub test()
Dim ws As Worksheet
Set source = Sheets("Total")
Dim LC As Long
With ThisWorkbook.Sheets("Total")
LC = Cells(1, Columns.Count).End(xlToLeft).Column
Columns(LC).Copy
Cells(1, LC + 1).PasteSpecial Paste:=xlPasteValues
End With
End Sub
My data looks like this:
A B
[TABLE="width: 447"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]
[/TD]
[TD]West[/TD]
[TD="align: right"]58[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]East[/TD]
[TD="align: right"]68[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]North[/TD]
[TD="align: right"]4[/TD]
[/TR]
</tbody>[/TABLE]
Secondly, I want it to be creating a sheet, insert timestamp as the sheet's name and then paste my data in the sheet each time I run it.
Thank you all in advance