ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Break links (https://www.excelbanter.com/excel-programming/385573-break-links.html)

dwaynesworld

Break links
 
I have a workbook which will automatically save a copy of a roster when
printing the roster and I would like to have this macro break the link to the
main workbook when saving. Here is my current code:

Sub Copy_Save_OneDay_Sheet()
'
' Copy_Save_OneDay_Sheet Macro
'
Sheets("Roster(1 Day)").Select
Sheets("Roster(1 Day)").Copy
Do
fname = Application.GetSaveAsFilename
Loop Until fname < False Or msoButtonSetCancel

If fname < False Then
ActiveWorkbook.SaveAs fname
ActiveWorkbook.Close savechanges:=False
End If

End Sub

Can anyone help? Thanks

Ron de Bruin

Break links
 
Hi dwaynesworld

You can add code like in the link after you create the new workbook
with Sheets("Roster(1 Day)").Copy

http://www.rondebruin.nl/values.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"dwaynesworld" wrote in message ...
I have a workbook which will automatically save a copy of a roster when
printing the roster and I would like to have this macro break the link to the
main workbook when saving. Here is my current code:

Sub Copy_Save_OneDay_Sheet()
'
' Copy_Save_OneDay_Sheet Macro
'
Sheets("Roster(1 Day)").Select
Sheets("Roster(1 Day)").Copy
Do
fname = Application.GetSaveAsFilename
Loop Until fname < False Or msoButtonSetCancel

If fname < False Then
ActiveWorkbook.SaveAs fname
ActiveWorkbook.Close savechanges:=False
End If

End Sub

Can anyone help? Thanks



All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com