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
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks