+ Reply to Thread
Results 1 to 4 of 4

Copy & Paste macro

  1. #1
    Forum Contributor
    Join Date
    11-23-2004
    Location
    Bristol
    MS-Off Ver
    2016
    Posts
    225

    Question 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.

  2. #2
    R.VENKATARAMAN
    Guest

    Re: Copy & Paste macro

    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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




  3. #3
    Forum Contributor
    Join Date
    11-23-2004
    Location
    Bristol
    MS-Off Ver
    2016
    Posts
    225

    Smile Copy & paste macro

    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.

  4. #4
    R.VENKATARAMAN
    Guest

    Re: Copy & Paste macro

    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
    --
    remove $$$ from email addresss to send email
    ____________________________________________
    "sparx" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1