Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro error
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
error bars in VBA excel 2007 macro | Charts and Charting in Excel | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Problem with excel macro - getting automation error | Charts and Charting in Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |