Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
code to update a macro
Chip Pearson's page on programming in the VBE:
http://www.cpearson.com/excel/vbe.htm should get you started. -- regards, Tom Ogilvy "Paul" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
update code | Excel Discussion (Misc queries) | |||
Any way to update links tru VBA code? | Excel Programming | |||
Automatic update of code in other workbook | Excel Programming | |||
Code to Update a Record | Excel Programming | |||
Update VBA Module Code | Excel Programming |