+ Reply to Thread
Results 1 to 1 of 1

Macro Problem: Copy contents of cell; search for contents in another workbook

  1. #1
    Registered User
    Join Date
    09-04-2014
    Location
    Tampa
    MS-Off Ver
    2010
    Posts
    1

    Macro Problem: Copy contents of cell; search for contents in another workbook

    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?
    Last edited by jfishstik; 09-04-2014 at 12:27 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Copy Paste Contents based on contents in designated cell
    By nickmessick1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2014, 01:23 PM
  2. Copy row contents depending on Cell A contents?
    By Mattneedshelp in forum Excel General
    Replies: 5
    Last Post: 05-07-2012, 05:18 AM
  3. Replies: 4
    Last Post: 03-15-2011, 10:56 AM
  4. Copy contents of cell to another workbook
    By MrEnigma in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-28-2008, 05:55 PM
  5. [SOLVED] how do I copy the contents of a cell from one workbook to another
    By Edith F in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-19-2005, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1