You can use a VBA-macro. Change the range, to whatever you want. I choose A1:B3. Also you should change the filepath to a path, which you like.
ActiveWorkbook.SaveAs Filename:= _
, FileFormat:=xlCSV, CreateBackup:=False, Local:=True
Application.DisplayAlerts = False
Application.DisplayAlerts = True
How to add a button to the excel-sheet to execute the macro
Add a button (Form control)
- If the Developer tab is not available, display it.
- Click the Microsoft Office Button Button image, and then click Excel Options.
- In the Popular category, under Top options for working with Excel, select the Show Developer tab in the Ribbon check box, and then
On the Developer tab, in the Controls group, click Insert, and then under ActiveX Controls, click Command Button Button image.
Click the worksheet location where you want the upper-left corner of the command button to appear.
- In the Controls group, click View Code.
This starts the Visual Basic Editor. Make sure that Click is selected in the dropdown
list on the right. The sub procedure called
shown in the following picture, runs two macros when the button is
Now just repace the code of the
CommandButton1_Clickwith the code inside the sub which I've posted on top of this.