Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #25  
Old 07-22-2014, 11:54 AM
gbaker gbaker is offline Choose file name Save As macro Windows 7 32bit Choose file name Save As macro Office 2010 32bit
Competent Performer
Choose file name Save As macro
 
Join Date: May 2012
Posts: 111
gbaker is on a distinguished road
Default Save As Not Working

Hi Bob,
This project is very important and although I always want to know I can't take the time on this one.

I found a code that works. It allows me to save the workbook to a directory on the network, take a name from the A1 cell in the original, adds today's date which renames the workbook, and now original goes back unchanged for the next time I need to use it. It also removes a tab called UPDATE (where the buttons for the Macro's are located) from the new saved workbook: Thanks Again for your help!! I'll get back to you when time allows. Here is the code I found:

Code:
'Saves filename as value of A1 plus the current date
     
    Dim newFile As String, fName As String
     ' Don't use "/" in date, invalid syntax
    fName = Range("A1").Value
     'Change the date format to whatever you'd like, but make sure it's in quotes
    newFile = fName & " " & Format$(Date, "mm-dd-yyyy")
     ' Change directory to suit your PC, including USER NAME
    ChDir _
    "J:\ProgramOps\Exceptions Masters & Data\Aon Hewitt"
    ActiveWorkbook.SAVEAS Filename:=newFile
    Sheets("UPDATE").Select
    ActiveWindow.SelectedSheets.Delete
    ActiveWorkbook.Save
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Choose file name Save As macro Macro to save as pdf with ability to choose save as folder rvessio Word VBA 4 07-25-2016 12:37 PM
Choose file name Save As macro Outlook 2010 Macro Save as MSG, Choose Destination, set default filename rslck Outlook 1 06-19-2014 10:16 AM
Choose file name Save As macro Save As Macro that changes the file name also rosscortb Word VBA 5 05-19-2014 08:40 AM
How do I save a Word file with a macro for distribution? leemoreau Word VBA 3 10-04-2013 08:06 AM
Choose file name Save As macro Word Macro: Save file as text with current file name jabberwocky12 Word VBA 2 10-22-2010 12:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft