I am trying to create a macro that copys the contents of a cell, switches workbooks, searches for the copied contents. If it finds the contents, it copies the adjacent cell, switches back to the other workbook, moves three cells to the right and pastes the contents. It is not working. Here is my code:
ActiveCell.FormulaR1C1 = "Part Number 1"
Windows("MFG_Crossref.xls").Activate
Cells.Find(What:="Part Number 1", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "Part Number 2"
Windows("workbook1.xlsx").Activate
ActiveCell.Offset(0, 3).Range("A1").Select
ActiveCell.FormulaR1C1 = "Part Number 2"
ActiveCell.Offset(1, -3).Range("A1").Select
The values are now stuck in the macro. It executes fine but only uses these values. This means that when I start the macro again from the next cell down, it uses the original values and just pastes them again. How do I fix this?
Bookmarks