This simple code is just to copy a data from a sheet and to paste them in another sheet but before that, it will find the last row with value so it will paste the data to the next row, the empty one.
When I use the macro ?
To copy a data from a sheet then to paste it to another sheet from the first empty cell.
How to create the macro ?
Read How to create, edit, hide and select a macro in an excel report
How to create the button to associate it with the macro ?
Read How to create a button and associated it to a macro in an excel report
How is the macro ?
Copy the code below and paste it into your macro. You will see my comments in green if exist so follow the help to adapt to your need. This one should be run from Sheet1 (the sheet where to paste):
Sub test()
Dim LastRow As Long
' change Sheet1 by your sheet name where to paste
LastRow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
' change Sheet2 by your sheet name where to copy and Sheet1 by the same name to paste
' change A2:D5 by your cell reference to copy
Sheets("Sheet2").Range("A2:D5").Copy Sheets("Sheet1").Cells(LastRow, 1)
End Sub
This one should be run from Sheet2 (the sheet where to copy):
Sub test()
Dim LastRow As Long
Dim rng As Range
' change Sheet1 by your sheet name where to paste
LastRow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
Set rng = ActiveSheet.UsedRange
Set rng = rng.Offset(1).Resize(rng.Rows.Count - 1)
rng.Select
rng.Copy Sheets("Sheet1").Cells(LastRow, 1)
End Sub
When you are managing a team, “how to be a good manager” is the “must”...
As manager, I am doing many reports, even when I was an ITIL consultant, I still needed to do many reports...
ITIL V3 is going to be obsolete...
Managing an IT service when I start a new company is not an easy task, particularly true, if the service...