Comment faire pour faire pareil mais avec le collage seulement des valeurs, svp ?
Bien à vous
For copying or exporting a selected range to a new workbook, normally, you may copy the range firstly, create a new workbook, and then paste the selected range to that new workbook, finally save this workbook manually. In this tutorial, we will show you time-saving methods of copying a selected range to a new workbook in Excel with details.
You can easily copy a selected range to a new workbook with VBA code. Please do as follows.
1. Select the range you need to copy to a new workbook.
2. Press Alt + F11 keys simultaneously to open the Microsoft Visual Basic Application window.
3. In the Microsoft Visual Basic Application window, click Insert > Module. Then copy and paste the below VBA code into the Module window.
VBA code: copy selected range to a new workbook
Sub AddNew() Dim xWs As Worksheet Dim Rng As Range Set Rng = Application.Selection Application.Workbooks.Add Set xWs = Application.ActiveSheet Rng.Copy Destination: = xWs.Range("A1") End Sub
Note: In the code, A1 is the destination cell for locating the selected range content of the new workbook. You can change it based on your needs.
3. Press the F5 key to run the code.
4. Then a new workbook is created with your selected range content listed inside, please save this workbook manually.
In this section, we will introduce you the Export Range to File utility of Kutools for Excel. With this utility, you can easily export selected range to a new workbook.
1. Select the range you want to copy to new workbook, then click Enterprise > Import / Export > Export Range to File. See screenshot:
2. In the Export Range to File dialog box, select the Excel workbook option in the File format section, click the button to select a folder for saving the new file, and finally click the OK button. See screenshot:
1. If you want to convert all formulas in selected range to values in the new workbook, please check the Convert formulas to values box in the Workbook options section; and the Preserve formatting, preserve row heights and preserve column widths options can help to keep all formatting, row heights and column widths of selected rang in the new workbook.
2. Check the Open the file after exporting option, the new workbook with the selected range content will open directly after exporting.
3. And then a prompt box will pop out to remind you typing a file name for your new workbook, see screenshot:
4. Then click Ok button, the new workbook will be created and saved into the folder you specified.