Closed Thread
Results 1 to 2 of 2

Thread: MACRO Help

  1. #1
    Registered User
    Join Date
    08-24-2011
    Location
    Washington, USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    MACRO Help

    I have a Macro that was created by someone else with no notes. The macro moves information from one spreadsheet (A) to separate tabs on another spreadsheet (B).

    I am trying to add a new tab on spreadsheet (B)

    I copied one of the other tab macros within the big macro and changed the tab name to the new tab name and it will not work.

    The first macro works when you step into it, it will go to the "_om" tab and paste the information even though it says "_om2". The second macro is the one I created, and when it gets to "_pc" it gives me an error.

    Run-TIme error '1004': The text you entered is not valid reference or defined name

    Windows("X2173.xlsx").Activate
    Range("A2").Select
    Cells.Find(What:="Meter ID : X2146", After:=ActiveCell, LookIn:=xlValues _
    , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=True).Activate
    ActiveCell.Offset(8, 0).Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("_SUBREAD.XLSM").Activate
    Application.Goto Reference:="_om2"
    ActiveSheet.Paste
    Sheets("transf").Select
    Range("A1").Select


    Windows("X2173.xlsx").Activate
    Range("A2").Select
    Cells.Find(What:="Meter ID : X2599", After:=ActiveCell, LookIn:=xlValues _
    , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=True).Activate
    ActiveCell.Offset(8, 0).Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("_SUBREAD.XLSM").Activate
    Application.Goto Reference:="_pc"
    ActiveSheet.Paste

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,584

    Re: MACRO Help

    Please read all of our forum rules before posting again. In this post you have broken at least 3.

    Then restart the thread.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

Closed Thread

Thread Information

Users Browsing this Thread

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

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.2.0