Hello,
I created a link between two worksheet in the same
workbook using macro. The main worksheet where the data
is entered should update certain columns in another
worksheet.
When the macro is run, it should do the updation
automatically but its not working. Below is the macro
which I created. I really don't know what's wrong with it.
-----------
Sub DailyMOPS()
Application.Goto Reference:="mthProdDateRange"
Selection.Copy
Windows("MOPS.xls").Activate
Sheets("Daily MOPS").Select
Range("A5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthULG97Range"
Selection.Copy
Windows("MOPS.xls").Activate
Sheets("Daily MOPS").Select
Range("B5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthULG92Range"
Selection.Copy
Windows("MOPS.xls").Activate
Sheets("Daily MOPS").Select
Range("C5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthKeroRange"
Selection.Copy
Windows("MOPS.xls").Activate
Sheets("Daily MOPS").Select
Range("D5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthGORange"
Selection.Copy
Windows("MOPS.xls").Activate
Sheets("Daily MOPS").Select
Range("E5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthGO25Range"
Selection.Copy
Windows("MOPS.xls").Activate
Sheets("Daily MOPS").Select
Range("F5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthNaphthaRange"
Selection.Copy
Windows("MOPS.xls").Activate
Sheets("Daily MOPS").Select
Range("G5").Select
ActiveSheet.Paste
Application.Goto Reference:="mth180Range"
Selection.Copy
Windows("MOPS.xls").Activate
Sheets("Daily MOPS").Select
Range("H5").Select
ActiveSheet.Paste
Application.Goto Reference:="mthLSWRCrkRange"
Selection.Copy
Windows("MOPS.xls").Activate
Sheets("Daily MOPS").Select
Range("I5").Select
ActiveSheet.Paste
Range("A5:I30").Select
Selection.Sort Key1:=Range("A5"),
Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:= _
xlTopToBottom
ActiveWorkbook.Save
xltohtml
End Sub
------------------
Please help.
Thanks,
Sheela
Bill Manville - 03 Nov 2003 23:04 GMT
> When the macro is run, it should do the updation
> automatically but its not working.
Does it give an error or just not do what you wanted?
If an error, which line is highlighted when you click Debug and what is
the precise error message.
It is important to start the macro in the context that the macro
assumes. In this case the active workbook must be the one containing
the range named "mthProdDateRange".
Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup