Copy & Paste macro

  • Thread starter Thread starter sparx
  • Start date Start date
S

sparx

Please can anybody help - I have 2 database's in excel. At present
copy a range of cells in database 2 and in database 1 find the nex
empty "column A" row and then paste ( values only ) the data. Is ther
a macro that could do this for me so it looks down "column A" and find
the next empty row cell then copies the data into it - there is a catc
though - it must copy as values not a straight forward copy
 
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
 
Yes - I want to be able to highlight a certain cell in database 2 tha
will say - press here to auto copy to database 1 then when you press i
- it highlights an area of data in database 2 and then looks down th
column A in database 1 until it finds the next empty row then paste's
special ) the values then returns to the database 2
 
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).Offset(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
 
Back
Top