Move Only Selected Data From 1 Sheet To Another Sheets 1st Avaliable Empty ROW

xcruc1at3r

Board Regular
Joined
Aug 4, 2011
Messages
50
Hi Can Any One Modify this Marco so that it can paste Selected data from Sheet1 to 1st Available empty ROW in the Sheet2

Sub MoveData()

Dim Rng As Range

Set Rng = Selection 'assumed your selection on active sheet
Selection.Copy

'to paste on sheet name: "Sheet2"
Sheets("Sheet2").Range(Rng.Address).PasteSpecial (xlPasteAll)

End Sub

I need this because i want to maintain the database
The help will be highly appreciated :)
I need to submit this project as soon as possible it really important for my job
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
See if this approaches what you want. You did not say which column in Sheet2 the data should be pasted to so this code puts it starting in column A.

Code:
Sub CopySelected()
Dim NextRow&
With Sheets("Sheet2")
NextRow = .Cells.Find(What:="*", After:=.Range("A1"), SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1
Selection.Copy .Cells(NextRow, 1)
End With
End Sub
 
Upvote 0
Thanks a million bro it works great... bro will it work for multiple selection ? if can kindly modify it to do so :)
 
Last edited:
Upvote 0
Thanks a million bro it works great... bro will it work for multiple selection ?

Here bro:


Sub CopySelectedMultiple()
Dim NextRow&, rng As Range
With Sheets("Sheet2")
For Each rng In Selection.Areas
NextRow = .Cells.Find(What:="*", After:=.Range("A1"), SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1
Range(rng.Address).Copy .Cells(NextRow, 1)
Next rng
End With
End Sub
 
Upvote 0
awsomeeeeeeeeeeeeeeeeeeee!!!!!!!!!!!! Bro....Kewl

i have created a Main report + Linked Report each of them is like 5mb thanks to excel 2003 and if i'll create the database in the same Report by using this command so the Main report will be really heavy right!!... what if i create a Separate Database rather then a Database sheet!!...
will this kind of macro work on a Separate Main Database WorkBOOK
 
Upvote 0
what if i create a Separate Database rather then a Database sheet!!...
will this kind of macro work on a Separate Main Database WorkBOOK

I cannot say what will work or not work based on what you are referring to. Test it and see if it works. If it does not, post back with exactly what you are working with so someone can shed more knowledgeable insight.
 
Upvote 0
well this is my workbook and you can see that this is my Report that i am currently working on and the sheet (database) is basically based on daily activity of gensets we enter the data here and that auto moves to the sheets according to the updated remarks and i have to create a MAIN DATABASE and a summary report and i am using excel 2003 and the file size is already 5.6MB and if i will make a "MAIN database" in this report so it will go above 10 mb in a few months so i was thinking that when we paste/update this report so the newly entered data that we receive. the command that U created will help me in order that if we have to move the selected data from this database to Another MAIN database workbook which i will create in the my documents that will save this report from size problem. i think selected data should move to THis Main ITV Report.xls to the MAIN DATABASE.xls saved IN my Documents folder .


-- removed inline image ---
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,633
Members
452,933
Latest member
patv

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