troubleshooting Question

Save as vba / date

Avatar of W.E.B
W.E.B asked on
Microsoft Excel
8 Comments1 Solution289 ViewsLast Modified:
Hello,
Can you please help,
I'm trying to save the file based on a cell that contains date.

Sub SAVE_Range_XLS()

    Sheets("QB").Select
    Range("A1:H65000").Copy
    Sheets.Add.Range("A1").PasteSpecial xlPasteAll
    Application.CutCopyMode = False
    ActiveSheet.UsedRange.EntireColumn.AutoFit
    ActiveSheet.Move
   
    ActiveWorkbook.SaveAs FileName:="C:\Users\Wassim\Desktop\TR QB " & Format(Range("K3").Value, "yyyy-mm-dd") & ".xlsx"
    ActiveWorkbook.Close False
    Application.DisplayAlerts = False
    Application.ScreenUpdating = True
   
End Sub

Example,
file name  TR QB,  Cell K3 = 03/16/2013
Output should be save as   TR QB 03-16-2013

Also,
how do I save it as .txt

thanks,
ASKER CERTIFIED SOLUTION
terencino

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros