Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"