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?
Bookmarks