Hi Aman
Following is the code that performs your task.... now u can copy paste this
is the "personal" workbook and access the code while working with any other
application.

========================================
Sub save_file_on_time()

vYear = Year(Date)      'Current year

vMonth = Month(Date)    'Current Month

vDay = Day(Date)        'Current Day

vHour = Hour(Time)      'Current Hour

vMin = Minute(Time)     'Current Minute

vFileName = vYear & "-" & vMonth & "-" & vDay & "_" & vHour & vMin
 'Define the filename

vPath = "D:\extractfiles"       ' Define the file path - can be changed
accordingly

ActiveWorkbook.SaveAs vPath & "\" & vFileName & ".xls"      'Saving the
workbook.

ActiveWorkbook.Close

End Sub
==============================================

Hope this helps... else you can always mail back..

Regards,
Vivek Agrawal
Skype ID - vivek.agrawal83

GoogleMoonlight.com  - Saving energy-Save Earth




On Thu, Jul 23, 2009 at 6:41 AM, Aman Singh Aneja <amanan...@gmail.com>wrote:

>
> Hello Everyone
>
> Been following the group and have found many useful tips – so thank
> you.
>
> Wanted to know if anyone could help me –
>
> I would like to create a button in Excel that saves the file
> automatically with the following names in the d:\extractfiles folder
> and closes the current window.
>
> File name should be :   YYYY-MM-DD_HHMM.xls
>
> Since I have to create multiple files during the day I would not like
> have to manually enter that.
>
> Any help would be greatly appreciated!!!
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 5,000 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to