Hi,
I was wonding if you could help me out with some code efficiency. I have two workbooks - One I cycle through to find an existing result, the second I paste in the correct place. However I can't get it to work without using "DestWB.Activate" and "SrcWB.activate" to copy/paste once the result is found. This cycling between workbooks is the slowest bit of the code. Is there a more efficient way?
Sub HorizonImportSched()
'code for source workbook =SrcWB and destination workbook = DestWB
'Find DestWb and paste above
DestWB.Activate
With Range("C13:C" & LastDest)
Set EnterT = Cells.Find(What:=Cell, after:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
True, SearchFormat:=False)
If Not EnterT Is Nothing Then
Cells.Find(What:=Cell, after:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
True, SearchFormat:=False).Select
Selection.Offset(0, 10 + Di).Select
ActiveSheet.Paste
End If
End With
SrcWB.Activate
thanks for any assistance
Bookmarks