How to give names to the sheets using xlswrite?

7 visualizzazioni (ultimi 30 giorni)
Riya
Riya il 5 Apr 2021
Commentato: Image Analyst il 6 Apr 2021
I have written some file names using xls write. Not I have to name those sheets.i have a worksheet..in which there are 3 sheets and i want to name all those sheets.for example, where sheet1 is written..i want to write "duplicatefilesheet".in place of sheet2 i want to write "missing file sheet". In place of sheet3 i want to write "copyfilesheet".how can i do that..?please give some code

Risposte (1)

Image Analyst
Image Analyst il 5 Apr 2021
Did you look at the documentation? The sheet name is the 3rd input argument to xlswrite().
It's best to name them as you write them but if you forgot to and now need to rename lots of sheets, one way is to read them all in again and then write them out with the correct name. Another way is to use ActiveX but it's more complicated.
  2 Commenti
Riya
Riya il 6 Apr 2021
Hi.... I tried the third input arguement. But what happening there is one extra blank sheet is coming as sheet 1. and after that the sheets that i am naming are coming. How can I remove that extra sheet?
and is there any way that i could give sheet number alongwith sheet name.
Image Analyst
Image Analyst il 6 Apr 2021
Yes, two ways.
  1. Perhaps you can go into your Excel settings and tell it to start with 0 sheets open. If not,...
  2. You can use the DeleteEmptySheets() function in the attached class if you're using Windows.

Accedi per commentare.

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by