Save a File Using a Macro in Excel, Save a file to a particular location using a macro. Save a file as a particular type using a macro. Check out my online courses
Become an Affiliate and earn 25% on Course Sales
For more help visit my website or email me at easyexcelanswers@gmail.com.
code
Private Sub CommandButton1_Click()
Dim path As String
Dim filename1 As String
path = “C:UsersBarbDesktopdemo”
filename1 = Range(“C4”)
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=path & filename1 & “.xlsx”, FileFormat:=xlOpenXMLWorkbookFileFormat:=xlOpenXMLWorkbook
FileFormat:=xlOpenXMLWorkbook
Application.DisplayAlerts = True
Activeworkbook.close
End Sub
For more help visit my website or email me at easyexcelanswers@gmail.com.
Contact me regarding customizing this template for your needs.
Excel one-on-one on-line training available. Email me to arrange.
I am able to provide online help on your computer at a reasonable rate.
Check out my next one-hour Excel Webinar
I use a Blue condensor Microphone to record my videos, here is the link
Check out Crowdcast for creating your webinars
If you need to buy Office 2019 follow
I use Tube Buddy to help promote my videos
Check them out
Follow me on Facebook
TWEET THIS VIDEO
Follow me on twitter
easyexcelanswers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.
Watch more new videos about Excel Office | Synthesized by Mindovermetal English
Thank you! The key for me was adding the .txt after the file name.
is there a way to save the specific worksheet instead of the whole workbook itself?
Main issue remains the same as user can't give the file path. Idea is that as macro run, box appears & ask user to specify the path where want to save the file while in this video, path is being fixed while it need to be user defined. If, you know how to address the issue, kindly let me know like through dialogue box but that point to file opening.
Hi Barb
Thank you again for streamlining information
I need to do something similar I'm not sure if it is possible to do
Saving a .docx file instead with a specified name (file name=cell value)
A trillion thanks
You've made my year. Thank you!
That's great…
It works perfectly but the only thing is I also want to break all the links after save as the file. Is it possible ?
which is the code for the word document?
Very useful thanks. When I use this code it's work properly. but my saved macro file macros is not working. what kind of changes need to that. Kindly replay as soon as possible.
Tks!
Hi Barb! I've played with your teachings but I couldn't figure out a way to combine them. I'd like to have a master PO file that increases the number by 1 when I open it, then, after I input the data, I'd like to have a button to save the workbook to a specific location, then clear the contents of the master PO and have it ready for next time. Any way to do it?
Nice tutorial. But if I want to copy a diff extension file from an folder to pendrive inserted how can I do that can you help?
In a same way how to create a folder?
How can I have the file revert to the original file after hitting the save button?
Thank you so much
you deserve more subs!
Nice video but to bad when i close my excel and reopen the button disappears, help me
Thank You lady!!!
This is the one I've been looking for!
this not work in win 10 64 bit
Thank you .
Are you able to export an Excel sheet to save as a XML file via macro?
I have a macro for copying and pasting data from one sheet into another sheet where I have columns that are XML Sourced set up how an application I'm using will accept them. I currently run the macro to copy and paste one batch of records at a time into the sheet then have to hit Export and name the files (1, 2, 3 etc.). My macro removes the batch of entries and copies in the next set. If a macro could export and name the file the next number in sequence that would be great.
What if Madam !!!! if i want to save a file into sub folder of Active workbook path as pdf. I dont care where the file is being saved , the macro should save the file where the active workbook located and make subfolder. For example Macro Enabled Workbook is Saved into C:My FolderVouchers.xlsm. Now i want to save a PDF file into C:My FolderPayment VoucherVoucher_001.pdf without giving the address. just want to save where the activeworkbook is being saved. please madam guide me.
Hi mam. I have a question.. how to save as workbook from another workbook.
thank you for the efforts it was very clear example
Excellent
I have some issues kindly help me to resolve
1: how can i save the new file without micro without micro button
What if the paths are from a list that you need to loop from? Different files names into different paths that will loop from a list?
its amazing mam.. i have a question, how to save as the sheet that we want, for example i want to save sheet 1 and sheet 6.. thaks mam, i really need your help
how to save as file with format macro… please
Hi there, may i know how can i name the file name as A1(name) + B1(date)?
Thanks a lot Barbara for this video. I used it. perfect lob.
Hi Barb,
I have used the same code as u mentioned, however the code / step for Saveas is getting debugged. Can you please advise why
Hello Barb
Video is really helpful..thanks for sharing it.
Can you please share the code if the file in the designated path is already there…how to display the option to save it again with different name???
Pls help me with this.
Thanks
Great. Thanks for making this video, very helpful. But I don't want to close the active workbook after saving the file. Can anyone please help me out?
Hi Barb, How can I make it save to an FTP location?
can you please copy paste this code
Awesome breakdown! You should be a teacher! Nice video!😀
Just noticed that the coding in description section is missing the term ".Text" from line "filename1 = Range("C4")" and two extra pasted in text "FileFormat:=xlOpenXMLWorkbook"
Thanks
I need your guidance here to copy the latest file in a folder and paste it in another path. Can you please help me on this..
thank you so much,it helped me alot…
Really helpful and interesting! Is it possible to save in 2 differents path according to a specific cell value (path1 or path2)?
mere isme error aa raha hai
I am your subscriber I support your channel thank you
Super madam very nice bt I need agine one more question how to automatically open file my friend send one excel file to email me download then use hear save to pdf button have me click the button automatically open this workbook location one ( pdf folder) open then inside this pdf file have when I delete this pdf Fila not possible this he how to make please explain madam
Hi. What do I need to change in this code that the original excel stays active? Right now it automatically opens the saved excel and I dont want it to become active. I mean if I want to continue editing the original excel file.
Hi Barb just joined to your channel please also make video on power bi eagerly waiting for power bi series video
Thank you so much, it was easy to understand and implement
Madam how to capy sheet2 in specific folder and path with cells name using userform..??
I really like how straightforward this is. So much so that I’ve subscribed for more. However I have a problem with the macro. When I run it I finish up with a line highlighted in yellow. The line in question starts “ActiveWorkbook.SaveAs” and the message on screen is “Run-time error ‘1004’ Method ‘SaveAs’ of object ‘_Workbook’ failed. I am using Excel 2016. Can I please have a solution as the macro is perfect for the sheet I’m preparing.