Overwrite an existing excel file (multiple sheets)
    2 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Francesca Danielli
 le 28 Déc 2021
  
    
    
    
    
    Commenté : Francesca Danielli
 le 29 Déc 2021
            Hi everyone!
I have imported an Excel file with N=20 sheets.
Each sheet contains two coloumns.
I create two cell arrays, Cf, Ci in the figure.

The following figure shows how each cella array is made.

Finally, the following figure shows how each table is made (in particular, Var1 e Var2 of Ci correspond to the 2 coloumn of esch excel sheet).

I would like to:
- add Var1 and Var2 of Cf to each table of Ci;
- overwrite the existing excel file with the modified sheets --> each sheet will have two coloumn corresponding to Ci and two coloumns corresponding to Cf.
Do you have any suggestion?
Thank you in advance!
1 commentaire
  Stephen23
      
      
 le 28 Déc 2021
				"Do you have any suggestion?"
Do NOT use the variable name DIR, because this will shadow the very important inbuilt DIR function.
Réponse acceptée
  Image Analyst
      
      
 le 28 Déc 2021
        You can call xlswrite() or writetable() one sheet at a time.  It should add the new sheets and retain the existing sheets.
4 commentaires
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Spreadsheets dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


