• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need help in macro

Hi,

I have recorded all my steps in macro.. Now I want macro to save the file with today's date


To be more precise

I have a downloaded file, where I have recorded one macro which apply few formula's and filter and give me few records.

This I was able to acheive

NOw i want system to save it automatically with today's date
 
Hi, Manish!


What do you try to mean with save it automatically with today's date?


In a macro you can use a instruction like:

<variable> = Now()

to retrieve and use the current date and time, and like:

ActiveWorkbook.Save

to save current workbook... but I don't understand what do you try to achieve.


Could you please elaborate a bit more?


Regards!
 
SirJB7,


I have recorded one macro for the daily report.(I don't know to write macro, So just recorded all the steps.)

Once all my steps are over, I want macro to save as COPK_today'sdate.xls
 
Hi, Manish!


When you record a macro, it's automatically stored within your active workbook (the file from where you recorded, even if during recording session you change or activate another one), and it's saved with names standard like MacroN, where N is a sequential integer from 1 in advance, in modules named standard too like ModuleN, where N as previous.


So, you can't only save a macro as a workbook .xls file (or .xlsb or .xlsm), you save the workbook that contains the macro. So if you save that workbook with the desired name I think you'll achieve your goal.


Regards!


EDIT: you can change the macro and module names from within the VBA editor (Alt-F11)
 
Hi, jflav@gmx.net!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the three first green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about your post in this topic... I should refer you to the third green sticky post, paragraph 14th: "Start a new post every time you ask a question, even if the theme is similar. The original author may continue asking questions whilst the post is in progress and of course if you are answering questions you may need to ask questions of the initial poster."


And about questions in general... paragraph 17th: "Quickly search the Web and Chandoo.org for help before posting. It is quite possible that your problem has been solved by someone else.".


So if you haven't performed yet the search herein, try going to the topmost right zone of this page (Custom Search), type suitable keywords and press Search button. You'd retrieve many links from this website, maybe you find useful information and even the solution. If not please advise so as people who read it could get back to you as soon as possible.


Related to your question, could you please elaborate a bit more? It's not clear at all what you tried to mean. If it's a list of all macros within a certain workbook, you can get it pressing Alt-F8 from Excel, then selecting source from the dropdown listbox.


Regards!
 
Hi,


Suppose my excel name is saved as tracker.xlsm which consist of recorded workflow which does all my calculation.. Once it displays all data I want it to store in a particular location with name as manish_today's date.xls
 
Hi, Manish!


Try adding this as last line in your macro or VBA code:

ActiveWorkbook.SaveAs filename

where filename is the full path & name: e.g., "C:xxxxyyyymanish_" & format$(now(),"yyyy-mm-dd") & ".xlsm"


Regards!
 
Hi, Manish!

Glad you solved it. Thanks for your feedback and for your kind words too. Welcome back whenever needed or wanted.

Regards!
 
Back
Top