Hi, I have the below code SaveFileAs that's saving the file with a specific format and I would like to export the file in CSV format and I do have the below code for it, however is there any way to merge the CSV mcro in SaveAs or provide the specific format while Saving CSV macro.
The output has to be in certain format and with 2 of the below code, I am unable to save it as one file.
Any help would be greatly appreciated, Had been stuck for sometime 
Sub SaveFileAs()
'-----Directory Properties----'
Dim fso As Object, _
ShellApp As Object, _
File As Object, _
SubFolder As Object, _
Directory As String, _
Problem As Boolean, _
ExcelVer As Integer
'-----File Properties----------'
Dim strName As String
Dim period As String
Dim dateStamp As String
Dim timeStamp As String
Dim fileName As String
Dim userId As String
'-----start HAVE USERS SELECT DIRECTORIES-----'
'------Create objects to get a listing of all files in the directory
Set fso = CreateObject("Scripting.FileSystemObject")
'--------Prompt user to select a directory-----'
Do
Problem = False
Set ShellApp = CreateObject("Shell.Application"). _
Browseforfolder(0, "Please choose a folder", 0, "c:\\")
On Error Resume Next
'-----Evaluate if directory is valid-----'
Directory = ShellApp.self.Path
Set SubFolder = fso.GetFolder(Directory).Files
If Err.Number <> 0 Then
If MsgBox("You did not choose a valid directory!" & vbCrLf & _
"Would you like to try again?", vbYesNoCancel, _
"Directory Required") <> vbYes Then Exit Sub
Problem = True
End If
On Error GoTo 0
Loop Until Problem = False
'-------end USERS SELECT DIRECTORIES------'
'------start FILE SAVE----------'
dateStamp = Format(FormatDateTime(Now, vbShortDate), "MM-DD-YYYY")
timeStamp = Format(FormatDateTime(Now, vbLongTime), "hms")
fileName = Directory & "\" & strName & "~" & period & "~" & userId & "~WorkID~" & dateStamp & "~" & timeStamp
MsgBox "Saving File ..." & fileName
saveFlag = 1
ActiveWorkbook.SaveAs fileName
'ActiveWorkbook.SaveAs Directory & "\" & "SCF 2008 Template_Q108_Hv1.1"
saveFlag = 0
End Sub
Sub CSV()
Dim SrcRg As Range
Dim CurrRow As Range
Dim CurrCell As Range
Dim CurrTextStr As String
Dim ListSep As String
Dim FName As Variant
Dim delimit As String
FName = Application.GetSaveAsFilename("", "CSV File (*.csv), *.csv")
ListSep = Application.International(xlListSeparator)
Set SrcRg = Sheets("Sheet2").UsedRange
Open FName For Output As #1
For Each CurrRow In SrcRg.Rows
CurrTextStr = ""
For Each CurrCell In CurrRow.Cells
CurrTextStr = CurrTextStr & """" & CurrCell.Value & """" & ListSep
Next
While Right(CurrTextStr, 1) = ListSep
CurrTextStr = Left(CurrTextStr, Len(CurrTextStr) - 1)
Wend
Print #1, CurrTextStr
Next
Close #1
End Sub
Bookmarks