S
Sheela
Hello,
Ths coding below is giving an error. I had posted this
question before but I don't really see any problem:
Sub DailyMOPS()
Application.Goto Reference:="mthProdDateRange"
Selection.Copy
Windows("Mopsprod.xls").Activate
Worksheets("Daily MOPS").Select
Range("A5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthULG97Range"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("B5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthULG92Range"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("C5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthKeroRange"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("D5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthGORange"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("E5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthNaphthaRange"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("F5").Select
ActiveSheet.Paste
Application.Goto Reference:="mth180Range"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("G5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthLSWRCrkRange"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("H5").Select
ActiveSheet.Paste
Range("A5:H30").Select
Selection.Sort Key1:=Range("A5"),
Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:= _
xlTopToBottom
ActiveWorkbook.Save
xltohtml
End Sub
The error message says:
"Run-time error '1004':
The text you entered is not a valid reference or defined
name."
As for the first line in the macro,
the "mthProdDateRange" is named. The range of this
reference is "A5:A27" but even after I change it gave me
the same error msg.
This macro is called in another sub function:
Application.Run Macro:="Mopsprod.xls!DailyMOPS"
Any idea why does this occur?
Thanks,
Sheela
Ths coding below is giving an error. I had posted this
question before but I don't really see any problem:
Sub DailyMOPS()
Application.Goto Reference:="mthProdDateRange"
Selection.Copy
Windows("Mopsprod.xls").Activate
Worksheets("Daily MOPS").Select
Range("A5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthULG97Range"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("B5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthULG92Range"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("C5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthKeroRange"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("D5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthGORange"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("E5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthNaphthaRange"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("F5").Select
ActiveSheet.Paste
Application.Goto Reference:="mth180Range"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("G5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthLSWRCrkRange"
Selection.Copy
Windows("Mopsprod.xls").Activate
Range("H5").Select
ActiveSheet.Paste
Range("A5:H30").Select
Selection.Sort Key1:=Range("A5"),
Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:= _
xlTopToBottom
ActiveWorkbook.Save
xltohtml
End Sub
The error message says:
"Run-time error '1004':
The text you entered is not a valid reference or defined
name."
As for the first line in the macro,
the "mthProdDateRange" is named. The range of this
reference is "A5:A27" but even after I change it gave me
the same error msg.
This macro is called in another sub function:
Application.Run Macro:="Mopsprod.xls!DailyMOPS"
Any idea why does this occur?
Thanks,
Sheela