Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mo Mo is offline
external usenet poster
 
Posts: 69
Default macro to save as

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default macro to save as

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   Report Post  
Posted to microsoft.public.excel.programming
Mo Mo is offline
external usenet poster
 
Posts: 69
Default macro to save as

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default macro to save as

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   Report Post  
Posted to microsoft.public.excel.programming
Mo Mo is offline
external usenet poster
 
Posts: 69
Default macro to save as

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default macro to save as


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
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
Macro to Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
Save As macro BigDave[_4_] Excel Programming 3 June 8th 05 05:10 PM
ASP: Open Excel File with Macro, Allow Macro to run, and then save delgados129 Excel Programming 0 March 10th 05 09:35 PM
Prompted to save changes after macro save - why? Izar Arcturus Excel Programming 2 December 10th 03 09:27 PM


All times are GMT +1. The time now is 04:13 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"