ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Paste Macro (https://www.excelbanter.com/excel-programming/349496-copy-paste-macro.html)

[email protected]

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



All times are GMT +1. The time now is 02:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com