Hi Helpers,
I have a piece of code which creates a new, standalone .csv file out of a sheet of my excel. What I need is to put only the first 10 columns of the sheet into the .csv and not the last five. Can you help me how to modify the script?
I have a piece of code which creates a new, standalone .csv file out of a sheet of my excel. What I need is to put only the first 10 columns of the sheet into the .csv and not the last five. Can you help me how to modify the script?
VBA Code:
Sub save_worksheets_win()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim munkafuzetNeve As String
munkafuzetNeve = ThisWorkbook.Name
objects = Array("Sheet1")
For Each Object In objects
fn = ThisWorkbook.Path & Application.PathSeparator & Object
On Error Resume Next
ThisWorkbook.Sheets(Object).Copy
If munkafuzetNeve <> ActiveWorkbook.Name Then
ActiveWorkbook.SaveAs Filename:=fn, FileFormat:=xlCSV, CreateBackup:=False
ActiveWorkbook.Close
End If
Next Object
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub