Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 01-22-2017, 08:32 AM
jolivanes jolivanes is offline How to save Excel file by field name as filename Windows XP How to save Excel file by field name as filename Office 2007
Advanced Beginner
 
Join Date: Sep 2011
Posts: 91
jolivanes will become famous soon enough
Default

Code:
Sub Maybe()
    Dim wb1 As Workbook, wbName As String, j As Long
    Application.ScreenUpdating = False
    Set wb1 = ThisWorkbook
    wbName = wb1.Sheets("Sheet1").Cells(4, 3).Value & " " & wb1.Sheets("Sheet1").Cells(5, 3).Value
    ActiveWorkbook.SaveAs Filename:=CreateObject("WScript.Shell").Specialfolders("Desktop") & "\" & wbName, _
    FileFormat:=xlOpenXMLWorkbookMacroEnabled
    ActiveWorkbook.Close
  Application.ScreenUpdating = True
End Sub
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to save Excel file by field name as filename How can I save a Word Document as a PDF file with a merged field filename? kp2009 Word VBA 5 08-27-2015 11:45 PM
Excel connot open file (filename) xlsx dengeorge6 Excel 0 12-12-2014 01:36 AM
Save Filename based on Text Field madcar86 Word VBA 8 10-19-2014 12:53 AM
How to save Excel file by field name as filename Auto update Filename field Oliver Beirne Word VBA 4 10-19-2012 03:33 AM
How to save Excel file by field name as filename Save Filename using Document Text Knawl Word 11 10-10-2011 03:00 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:12 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