+ Reply to Thread
Results 1 to 2 of 2

Excel and VBA.

  1. #1
    SdbX
    Guest

    Excel and VBA.

    There are two books. As from one book to execute search of a free line in the
    second books.
    And how to transfer the data in the second book?

  2. #2
    Tom Ogilvy
    Guest

    Re: Excel and VBA.

    Place in a code module in Book1.xls

    Sub CopyToBook1()
    Dim rng as Range
    Dim rng1 as Range
    set rng = Workbooks("Book2.xls") _
    .WorkSheets("Sheet1").Range("A1:A500")
    set rng1 = rng.Find("ABC")
    if not rng1 is nothing then
    rng1.EntireRow.copy Destination:= _
    workbooks("Book1.xls").Worksheets("Sheet1") _
    .Cells(rows.count,1).End(xlup)(2)
    Else
    msgbox "ABC not found"
    End if
    End Sub

    --
    Regards,
    Tom Ogilvy



    "SdbX" <[email protected]> wrote in message
    news:[email protected]...
    > There are two books. As from one book to execute search of a free line in

    the
    > second books.
    > And how to transfer the data in the second book?




+ 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