I would like to save a worksheet as a csv file, but I don't want to save the columns that are hidden. Is this even possible?
I'm currently using the following macro to save the worksheet as the csv. Maybe it could be modified?
I'm currently using the following macro to save the worksheet as the csv. Maybe it could be modified?
Code:
Sub Export()
'
' Macro2 Macro
'
'
Application.ScreenUpdating = False
Columns("B:Z").Select
Selection.Copy
Sheets.Add.Name = "Export"
Sheets("Export").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("M:M").Select
Selection.Delete Shift:=xlToLeft
Columns("V:V").Select
Selection.NumberFormat = "m/d/yyyy h:mm"
Columns("W:W").Select
Selection.Delete Shift:=xlToLeft
Range("a5").Select
Application.DisplayAlerts = False
ChDir "\\SERVER\CPSQL"
ActiveWorkbook.SaveAs Filename:= _
"\\SERVER\CPSQL\SGProducts.csv" _
, FileFormat:=xlCSV, CreateBackup:=False
Workbooks.Close
Application.DisplayAlerts = True
End Sub