hi,
i want to save a single worksheet named TransferFile in a workbook as a separate CSV file. This is as far as i've gotten, but it saves every sheet as a new CSV file instead of just the one i want. not sure how to get it to do what i want.
Any help is greatly appreciated!
-B
Sub ExportFileUploadAsCSV()
Dim ws As Worksheet
Dim sFolderPath As String
sFolderPath = "B:\Operations\Brian\MACRO PROJECTS\Bond Upload\"
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible Then
ws.Copy
ActiveWorkbook.SaveAs _
Filename:=sFolderPath & ws.Name, _
FileFormat:=xlCSV
ActiveWorkbook.Saved = True
ActiveWorkbook.Close False
End If
Next ws
End Sub
i want to save a single worksheet named TransferFile in a workbook as a separate CSV file. This is as far as i've gotten, but it saves every sheet as a new CSV file instead of just the one i want. not sure how to get it to do what i want.
Any help is greatly appreciated!
-B
Sub ExportFileUploadAsCSV()
Dim ws As Worksheet
Dim sFolderPath As String
sFolderPath = "B:\Operations\Brian\MACRO PROJECTS\Bond Upload\"
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible Then
ws.Copy
ActiveWorkbook.SaveAs _
Filename:=sFolderPath & ws.Name, _
FileFormat:=xlCSV
ActiveWorkbook.Saved = True
ActiveWorkbook.Close False
End If
Next ws
End Sub