View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] alfred.cloutier@gmail.com is offline
external usenet poster
 
Posts: 13
Default Copy Paste Macro

Is there a neat macro out there that will copy and paste all instances
of a specified word in a worksheet into another workbook? Right now I
am using the macro below, which I have to do by hand and I always end
up with the search going back to the beginning and copying the first
instance again.

Sub coopy()
'
' coopy Macro
' Macro recorded 1/3/2006 by L Cloutier
'
' Keyboard Shortcut: Option+Cmd+e
'
Cells.FindNext(After:=ActiveCell).Activate ' this finds the next
instance of the word I'm looking for
ActiveCell.Offset(0, -1).Range("A1:C1").Select ' selects adjacent
cells
ActiveCell.Activate
Selection.Copy
Windows("meta.xls").Activate ' switches to another workbook
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
Windows("HIERARCH.xls").Activate
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub