Results 1 to 9 of 9

Run-Time Error '1004'

Threaded View

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

    Run-Time Error '1004'

    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 in (B) 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
    Is there a way to designate the _pc as a name. I was told to use a Dim ?? As ?? statement. If that is correct how would you state that?
    Attached Files Attached Files
    Last edited by omakbigd; 08-29-2011 at 01:02 PM.

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.6.0 RC 1