VBA- Copy and paste a range to another sheet

hebbebe

New Member
Joined
Sep 13, 2019
Messages
6
Hello!
I'm far from a expert in VBA so i need a bit of help.

Im trying to make a sheet, there i can save a list of all the projects i have completed in my work, and future projects.

I want press a button to copy row 10 in the worksheet: "Projekt", and paste it to last row in worksheet: "Biblotek". So it makes a list.
If you have any questions, i'll answer quickly as i can.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Assuming you have at least something in the sheet Biblotek, this will work
Code:
Private Sub CommandButton1_Click()
Dim LastRow As Long
LastRow = Sheets("Biblotek").Cells.Find(What:="*", After:=Sheets("Biblotek").Range("A1"), LookAt:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False).Row
Sheets("Projekt").Rows(10).Copy Sheets("Biblotek").Rows(LastRow + 1)

End Sub


This code is linked to a active X button:
1602273303703.png
 
Upvote 0

Forum statistics

Threads
1,215,659
Messages
6,126,071
Members
449,286
Latest member
Lantern

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top