Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Trying to save a worksheet

Help!!!

I recorded a macro to save as a worksheet in a workbook. I get the save as dialog box. What I want to do is once my data is populated in the worksheet to click my button (i want to attach my macro to )
save a new worksheet to the same directory every time with a different name like a date.
for example
c:\temp\07152004

And also not show the save as box I don't want to have to click any button just look in the temp directory and see file names.
is this doable?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Trying to save a worksheet

Hi
try something like

sub save_it
dim fname
dim fpath
fpath="c:\temp\"
fname=Format(now,"MMDDYYYY_hhmmss")
activeworkbook.saveas fpath & fname
end sub

--
Regards
Frank Kabel
Frankfurt, Germany


Saving a worksheet with different names wrote:
Help!!!

I recorded a macro to save as a worksheet in a workbook. I get the
save as dialog box. What I want to do is once my data is populated
in the worksheet to click my button (i want to attach my macro to )
save a new worksheet to the same directory every time with a
different name like a date.
for example
c:\temp\07152004

And also not show the save as box I don't want to have to click any
button just look in the temp directory and see file names.
is this doable?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Trying to save a worksheet

Frank you are awesome. This is what I wanted.
Thank you
Ptree
Chicago, Illinois




"Frank Kabel" wrote:

Hi
try something like

sub save_it
dim fname
dim fpath
fpath="c:\temp\"
fname=Format(now,"MMDDYYYY_hhmmss")
activeworkbook.saveas fpath & fname
end sub

--
Regards
Frank Kabel
Frankfurt, Germany


Saving a worksheet with different names wrote:
Help!!!

I recorded a macro to save as a worksheet in a workbook. I get the
save as dialog box. What I want to do is once my data is populated
in the worksheet to click my button (i want to attach my macro to )
save a new worksheet to the same directory every time with a
different name like a date.
for example
c:\temp\07152004

And also not show the save as box I don't want to have to click any
button just look in the temp directory and see file names.
is this doable?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Trying to save a worksheet

I would modify Frank's macro to put the year in front as
in YYYYMMDD_hhmmss in your backup.
That would make sure you know when you created it rather than
just going by what you see in the directory which is usually the
date modified.

"Frank Kabel" wrote in message ...
Hi
try something like

sub save_it
dim fname
dim fpath
fpath="c:\temp\"
fname=Format(now,"MMDDYYYY_hhmmss")
activeworkbook.saveas fpath & fname
end sub



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Trying to save a worksheet

Hi Ptree,
Please avoid changing the subject. It makes for confusion, because
it looks like it is in a separate thread. In Outlook Express we will see
replies below ours in RED. Since you posted through Communities,
I don't know what you see but you are able to identify replies to your
questions in some marked manner. Even if you supply the thankyou
to a different subthread chances are everyone in the thread will have
seen it.

When a Thank You is really important in a thread is when you get
divergent answers not replies that enhance each other but
completely different interpretations of the problem or different ways
of solving the same problem -- that is when the Thank You indicates
which solution is was actually used and why.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Thank you" <Thank wrote in message ...
Frank you are awesome. This is what I wanted.
Thank you


Ptree
Chicago, Illinois





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Trying to save a worksheet

Works great for me Frank but there's always something more, right? Can I
make the contents of a cell a prefix to the date code. In my case the
contents of cell c15 of the original workbook is a customer core that we put
in. This work help us sort saved files by customer when necessary.

"Frank Kabel" wrote:

Hi
try something like

sub save_it
dim fname
dim fpath
fpath="c:\temp\"
fname=Format(now,"MMDDYYYY_hhmmss")
activeworkbook.saveas fpath & fname
end sub

--
Regards
Frank Kabel
Frankfurt, Germany


Saving a worksheet with different names wrote:
Help!!!

I recorded a macro to save as a worksheet in a workbook. I get the
save as dialog box. What I want to do is once my data is populated
in the worksheet to click my button (i want to attach my macro to )
save a new worksheet to the same directory every time with a
different name like a date.
for example
c:\temp\07152004

And also not show the save as box I don't want to have to click any
button just look in the temp directory and see file names.
is this doable?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Trying to save a worksheet

Option explicit
Sub SaveIt2()

dim fName as string
dim fPath as string

fpath = "c:\temp\"

with activeworkbook
fname = .worksheets("sheet999").range("c15").value _
& format(now, "mmddyyyy_hhmmss") & ".xls"
.saveas filename:=fpath & fname, fileformat:=xlworkbooknormal
end with

End Sub



kennected wrote:

Works great for me Frank but there's always something more, right? Can I
make the contents of a cell a prefix to the date code. In my case the
contents of cell c15 of the original workbook is a customer core that we put
in. This work help us sort saved files by customer when necessary.

"Frank Kabel" wrote:

Hi
try something like

sub save_it
dim fname
dim fpath
fpath="c:\temp\"
fname=Format(now,"MMDDYYYY_hhmmss")
activeworkbook.saveas fpath & fname
end sub

--
Regards
Frank Kabel
Frankfurt, Germany


Saving a worksheet with different names wrote:
Help!!!

I recorded a macro to save as a worksheet in a workbook. I get the
save as dialog box. What I want to do is once my data is populated
in the worksheet to click my button (i want to attach my macro to )
save a new worksheet to the same directory every time with a
different name like a date.
for example
c:\temp\07152004

And also not show the save as box I don't want to have to click any
button just look in the temp directory and see file names.
is this doable?




--

Dave Peterson
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
How do I save only active worksheet without save all of worksheet droth Excel Worksheet Functions 2 February 21st 09 05:11 PM
When you hit Save on a template, how can you save as worksheet? cwgirl1982 Excel Worksheet Functions 1 September 4th 08 11:18 PM
'Save current worksheet'; 'Open next worksheet' - two command buttons englishmustard Excel Discussion (Misc queries) 1 April 7th 06 12:54 PM
Save worksheet to a CD Bill Wehner New Users to Excel 2 January 8th 06 11:28 PM
Worksheet Buttons (Save, Save As, Cut, Paste, etc.) Not Working SuzieQ12345 Excel Worksheet Functions 5 January 21st 05 02:57 PM


All times are GMT +1. The time now is 10:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"