+ Reply to Thread
Results 1 to 6 of 6

Save as using multiple Cells

Hybrid View

  1. #1
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Save as using multiple Cells

    Hi mille1sj,

    Enter following code in the workbooks for each manager and edit the Note in the code:-

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    
    Application.DisplayAlerts = False
    Application.ScreenUpdating = False
    'Note:- here I am using cell IV1 for some combining texts for workbook name, if required choose other cell
    Range("iv1").Formula = "=b5&""_""&b4&""_""&l3&""_""&TEXT(R3,""dd-mmm-yy"")"
    Range("iv1").Select
    i = ActiveCell.Value
    ChDir "C:\Users\DILIPandey\Desktop" 'Note:- change the path as per your preference
    ActiveWorkbook.SaveAs Filename:=i, FileFormat:=xlOpenXMLWorkbookMacroEnabled  
    
    'Note: remove code line FileFormat ...Enabled portion from above line if you face any issue with Excel 2003.
    
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    
    End Sub
    How to add:-
    open workbook, press Alt + F11, locate your workbook in left window, double click on "This workbook" and paste above code

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    Last edited by dilipandey; 03-31-2012 at 02:40 AM. Reason: Excel 2003 compatibility issue highlighted
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  2. #2
    Registered User
    Join Date
    07-20-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Save as using multiple Cells

    It works great! is ther a way to show the Save As box? I would like to show this in the event that they need to change the location slightly or change the file name?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1