MortalreminderPT / edit-xlsx

A quick and easy-to-use Rust library for Excel file editing.
https://crates.io/crates/edit-xlsx
22 stars 4 forks source link

[Feature request] Duplication of sheets #4

Closed Antonio225t closed 6 months ago

Antonio225t commented 6 months ago

It would be nice if you could duplicate worksheets inside a workbook. If you have a "Master" sheet and you can duplicate it, it'll be easier to change the values or add them.

MortalreminderPT commented 6 months ago

Thank you very much for your many valuable comments on this project, I will consider this feature carefully!😊

MortalreminderPT commented 6 months ago

After consideration, I have added two methods to the Worksheet methods: duplicate_worksheet() and duplicate_worksheet_by_name(). These methods allow you to copy a Worksheet by specifying either the sheet_id or the sheet_name.

Moreover, to enhance the usability of this feature, I have added deselect() method to deselect the Sheet and set_name() method to modify the Sheet's name.

You can utilize these methods in edit-xlsx 0.3.8, and refer to their usage in examples/duplicate_sheet.

If you are having problems with it, feel free to create an issue.