Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Links / November 2003

Tip: Looking for answers? Try searching our database.

Worksheet data update

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sheela - 03 Nov 2003 02:55 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.