![]() |
Create a button to Save As the workbook
Hi,
I would like to create a button that opens the Save As command - if possible? Thanks, Helen |
Create a button to Save As the workbook
Try:
Sub SaveAs() Dim flname As String Dim fullName As Variant Dim filter As String flname = "SaveName" filter = "Excel Files (*.xls), *.xls" fullName = Application.GetSaveAsFilename(flname, filter, , "MyFile") If fullName < False Then Application.DisplayAlerts = False ThisWorkbook.SaveAs fullName Application.DisplayAlerts = True End If End Sub Hope this helps Rowan Helen wrote: Hi, I would like to create a button that opens the Save As command - if possible? Thanks, Helen |
Create a button to Save As the workbook
Works great.
Thanks! Helen "Rowan Drummond" wrote in message ... Try: Sub SaveAs() Dim flname As String Dim fullName As Variant Dim filter As String flname = "SaveName" filter = "Excel Files (*.xls), *.xls" fullName = Application.GetSaveAsFilename(flname, filter, , "MyFile") If fullName < False Then Application.DisplayAlerts = False ThisWorkbook.SaveAs fullName Application.DisplayAlerts = True End If End Sub Hope this helps Rowan Helen wrote: Hi, I would like to create a button that opens the Save As command - if possible? Thanks, Helen |
Create a button to Save As the workbook
You're welcome.
Helen wrote: Works great. Thanks! Helen "Rowan Drummond" wrote in message ... Try: Sub SaveAs() Dim flname As String Dim fullName As Variant Dim filter As String flname = "SaveName" filter = "Excel Files (*.xls), *.xls" fullName = Application.GetSaveAsFilename(flname, filter, , "MyFile") If fullName < False Then Application.DisplayAlerts = False ThisWorkbook.SaveAs fullName Application.DisplayAlerts = True End If End Sub Hope this helps Rowan Helen wrote: Hi, I would like to create a button that opens the Save As command - if possible? Thanks, Helen |
Create a button to Save As the workbook
can you tell me why it saves then opens file it saved. works good but i need
to reopen file itwas saved from. have many formulas that need to be used.can we copy the woorkbook as a file and then do the other code I have in my existing woorkbook? this sets the woorkbookand sheets for next year. Any help appreciated Thanks Curt "Rowan Drummond" wrote: Try: Sub SaveAs() Dim flname As String Dim fullName As Variant Dim filter As String flname = "SaveName" filter = "Excel Files (*.xls), *.xls" fullName = Application.GetSaveAsFilename(flname, filter, , "MyFile") If fullName < False Then Application.DisplayAlerts = False ThisWorkbook.SaveAs fullName Application.DisplayAlerts = True End If End Sub Hope this helps Rowan Helen wrote: Hi, I would like to create a button that opens the Save As command - if possible? Thanks, Helen |
Create a button to Save As the workbook
A thought I guess what needs to happen is to copy the file with anew name
then procede with other code. need to study more new student at 68. having a good time with it. Thanks for any help Curt "Rowan Drummond" wrote: You're welcome. Helen wrote: Works great. Thanks! Helen "Rowan Drummond" wrote in message ... Try: Sub SaveAs() Dim flname As String Dim fullName As Variant Dim filter As String flname = "SaveName" filter = "Excel Files (*.xls), *.xls" fullName = Application.GetSaveAsFilename(flname, filter, , "MyFile") If fullName < False Then Application.DisplayAlerts = False ThisWorkbook.SaveAs fullName Application.DisplayAlerts = True End If End Sub Hope this helps Rowan Helen wrote: Hi, I would like to create a button that opens the Save As command - if possible? Thanks, Helen |
All times are GMT +1. The time now is 12:36 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com