LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default code to update a macro



I have written/recorded a little macro that removes an old
version of a worksheet and replaces it with the latest
version.I now wish to replace a old macro with a newer
version too.Can you give me the code that would transfer a
module from a new workbook(jul021) to the "old"
workbook,which happens to be called "mylinkname"
Sub update()
Application.DisplayAlerts = False
'Workbooks.Add Template:="\\w2k107132\Brendons
Docs\Templates\jul02.xlt"
Windows("jul021").Visible = False
Sheets("Cover").Select
mylinkname = Range("B6")
Sheets("Program").Select
Sheets("Program").Delete
Windows("jul021").Visible = True
Sheets("Program").Select
Sheets("Program").Copy Befo=Workbooks(mylinkname
& ".xls").Sheets(2)
ActiveWorkbook.ChangeLink Name:="jul021",
NewName:=mylinkname & ".xls", Type:= _
xlExcelLinks
Windows("jul021").Visible = False
Application.DisplayAlerts = True

End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
update code Lost Excel Discussion (Misc queries) 0 January 16th 09 04:53 AM
Any way to update links tru VBA code? nrage21[_47_] Excel Programming 1 March 5th 04 05:32 PM
Automatic update of code in other workbook Tony C[_2_] Excel Programming 2 February 17th 04 12:34 PM
Code to Update a Record No Name Excel Programming 1 January 29th 04 10:02 PM
Update VBA Module Code Todd Huttenstine[_2_] Excel Programming 1 December 27th 03 10:15 AM


All times are GMT +1. The time now is 12:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"