ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Copy & Paste macro (https://www.excelbanter.com/excel-worksheet-functions/44904-copy-paste-macro.html)

sparx

Copy & Paste macro
 

Please can anybody help - I have 2 database's in excel. At present I
copy a range of cells in database 2 and in database 1 find the next
empty "column A" row and then paste ( values only ) the data. Is there
a macro that could do this for me so it looks down "column A" and finds
the next empty row cell then copies the data into it - there is a catch
though - it must copy as values not a straight forward copy.


--
sparx
------------------------------------------------------------------------
sparx's Profile: http://www.excelforum.com/member.php...o&userid=16787
View this thread: http://www.excelforum.com/showthread...hreadid=466723


R.VENKATARAMAN

do you want it in vba programme
assume all filled rows contains some value in column A
then use something like this
Public Sub test()
Range ("F1:F5"), Copy
Range("a1").End(xlDown).Offset(1, 0).PasteSpecial xlPasteValues
End Sub


"sparx" wrote in
message ...

Please can anybody help - I have 2 database's in excel. At present I
copy a range of cells in database 2 and in database 1 find the next
empty "column A" row and then paste ( values only ) the data. Is there
a macro that could do this for me so it looks down "column A" and finds
the next empty row cell then copies the data into it - there is a catch
though - it must copy as values not a straight forward copy.


--
sparx
------------------------------------------------------------------------
sparx's Profile:

http://www.excelforum.com/member.php...o&userid=16787
View this thread: http://www.excelforum.com/showthread...hreadid=466723




sparx


Yes - I want to be able to highlight a certain cell in database 2 that
will say - press here to auto copy to database 1 then when you press it
- it highlights an area of data in database 2 and then looks down the
column A in database 1 until it finds the next empty row then paste's (
special ) the values then returns to the database 2.


--
sparx
------------------------------------------------------------------------
sparx's Profile: http://www.excelforum.com/member.php...o&userid=16787
View this thread: http://www.excelforum.com/showthread...hreadid=466723


R.VENKATARAMAN

save the two workbooks and open both of them
the data are in sheet1 of the two books in column A1 on
you want to copy data in column A of sheet1 of book2 to shee1 of book1 at
the botttom of the data in col A.

then
in book2 goto sheet1 open control toolbox click <commanbutton and create it
somewhere in the sheet 1.
right clik this command button and click view code
you will get some thing like this
Private Sub CommandButton1_Click()

End Sub

above < end sub copy the following code

===========
Dim copydata As Range
Dim tocopy As Range
Windows("book3.xls").Activate
Set copydata = Worksheets("sheet1").Range("a1:a6")
Windows("book2.xls").Activate
Set tocopy = Worksheets("sheet1").Range("a1").End(xlDown).Offse t(1, 0)
copydata.Copy Destination:=tocopy
=========
click design icon to remove design mode

now if you click the command button hope you will get what you want.
if any bug let me know
--
remove $$$ from email addresss to send email
____________________________________________
"sparx" wrote in
message ...

Yes - I want to be able to highlight a certain cell in database 2 that
will say - press here to auto copy to database 1 then when you press it
- it highlights an area of data in database 2 and then looks down the
column A in database 1 until it finds the next empty row then paste's (
special ) the values then returns to the database 2.


--
sparx
------------------------------------------------------------------------
sparx's Profile:

http://www.excelforum.com/member.php...o&userid=16787
View this thread: http://www.excelforum.com/showthread...hreadid=466723





All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com