Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to create a macro & assign it to a button. the macro needs to save
the current file based on a date that is entered in a cell. also the macro needs to prompt the user to verify the filename(date) and then save it and return to the current worksheet. thanks Mo |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sFilename = Format(Worksheets("Sheet1").Range("A1").Value, "yyyy-mm-dd")
ans = MsgBox ("Save file as " & sFilename) if ans = vbOK Then Activeworkbook.SaveAs Filename:= sFilename End If should do it -- HTH RP (remove nothere from the email address if mailing direct) "Mo" wrote in message ... I need to create a macro & assign it to a button. the macro needs to save the current file based on a date that is entered in a cell. also the macro needs to prompt the user to verify the filename(date) and then save it and return to the current worksheet. thanks Mo |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
I got an error message - "Complie Error, Invalid outside procedure" it highlite the ("A1") "Bob Phillips" wrote: sFilename = Format(Worksheets("Sheet1").Range("A1").Value, "yyyy-mm-dd") ans = MsgBox ("Save file as " & sFilename) if ans = vbOK Then Activeworkbook.SaveAs Filename:= sFilename End If should do it -- HTH RP (remove nothere from the email address if mailing direct) "Mo" wrote in message ... I need to create a macro & assign it to a button. the macro needs to save the current file based on a date that is entered in a cell. also the macro needs to prompt the user to verify the filename(date) and then save it and return to the current worksheet. thanks Mo |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need to put it in a sub:-)
Sub SaveMyFile() sFilename = Format(Worksheets("Sheet1").Range("A1").Value, "yyyy-mm-dd") ans = MsgBox ("Save file as " & sFilename) if ans = vbOK Then Activeworkbook.SaveAs Filename:= sFilename End If End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Mo" wrote in message ... Bob, I got an error message - "Complie Error, Invalid outside procedure" it highlite the ("A1") "Bob Phillips" wrote: sFilename = Format(Worksheets("Sheet1").Range("A1").Value, "yyyy-mm-dd") ans = MsgBox ("Save file as " & sFilename) if ans = vbOK Then Activeworkbook.SaveAs Filename:= sFilename End If should do it -- HTH RP (remove nothere from the email address if mailing direct) "Mo" wrote in message ... I need to create a macro & assign it to a button. the macro needs to save the current file based on a date that is entered in a cell. also the macro needs to prompt the user to verify the filename(date) and then save it and return to the current worksheet. thanks Mo |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
Thanks for your help. I will give it a try. I have one general question to ask. How or (can) do I hide the worksheet menu bar. I tried View, Toolbars, Customize and unclick the menu bar. But it still defaulted to show the menu bar. My intention is to not allow the user to delete, save as, or use other menus while in the work book. The workbook is all driven by macros and there is no need for user to use or "play" with the menu bar. Thanks Mo "Bob Phillips" wrote: You need to put it in a sub:-) Sub SaveMyFile() sFilename = Format(Worksheets("Sheet1").Range("A1").Value, "yyyy-mm-dd") ans = MsgBox ("Save file as " & sFilename) if ans = vbOK Then Activeworkbook.SaveAs Filename:= sFilename End If End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Mo" wrote in message ... Bob, I got an error message - "Complie Error, Invalid outside procedure" it highlite the ("A1") "Bob Phillips" wrote: sFilename = Format(Worksheets("Sheet1").Range("A1").Value, "yyyy-mm-dd") ans = MsgBox ("Save file as " & sFilename) if ans = vbOK Then Activeworkbook.SaveAs Filename:= sFilename End If should do it -- HTH RP (remove nothere from the email address if mailing direct) "Mo" wrote in message ... I need to create a macro & assign it to a button. the macro needs to save the current file based on a date that is entered in a cell. also the macro needs to prompt the user to verify the filename(date) and then save it and return to the current worksheet. thanks Mo |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Application.Commandbars("Worksheet Menu Bar").Enabled = False -- HTH RP (remove nothere from the email address if mailing direct) "Mo" wrote in message ... Bob, Thanks for your help. I will give it a try. I have one general question to ask. How or (can) do I hide the worksheet menu bar. I tried View, Toolbars, Customize and unclick the menu bar. But it still defaulted to show the menu bar. My intention is to not allow the user to delete, save as, or use other menus while in the work book. The workbook is all driven by macros and there is no need for user to use or "play" with the menu bar. Thanks Mo "Bob Phillips" wrote: You need to put it in a sub:-) Sub SaveMyFile() sFilename = Format(Worksheets("Sheet1").Range("A1").Value, "yyyy-mm-dd") ans = MsgBox ("Save file as " & sFilename) if ans = vbOK Then Activeworkbook.SaveAs Filename:= sFilename End If End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Mo" wrote in message ... Bob, I got an error message - "Complie Error, Invalid outside procedure" it highlite the ("A1") "Bob Phillips" wrote: sFilename = Format(Worksheets("Sheet1").Range("A1").Value, "yyyy-mm-dd") ans = MsgBox ("Save file as " & sFilename) if ans = vbOK Then Activeworkbook.SaveAs Filename:= sFilename End If should do it -- HTH RP (remove nothere from the email address if mailing direct) "Mo" wrote in message ... I need to create a macro & assign it to a button. the macro needs to save the current file based on a date that is entered in a cell. also the macro needs to prompt the user to verify the filename(date) and then save it and return to the current worksheet. thanks Mo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Insert Current Date into cell - Macro to "Save As" | Excel Worksheet Functions | |||
Macro to Save without the Save Message | Excel Discussion (Misc queries) | |||
Save As macro | Excel Programming | |||
ASP: Open Excel File with Macro, Allow Macro to run, and then save | Excel Programming | |||
Prompted to save changes after macro save - why? | Excel Programming |