Write cells to individual excel sheets
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
Hi, I'm having problems writting individual cells to individual sheets in excel. It states an invalid data range. I need to add the cell IDs above the orginal data.
Attached is the code for xlswrite.
Thanks
Load('Sample_data.mat');
Fnane = 'PD.xlsx';
%add cell ID above PD data for each cell.
for n = 1:numel(Sheet_names)
PD_adpt{n}(2,:) = PD_adpt{n}(1,:);
PD_adpt{n}(1,:) = Cell_ID;
end
for ii = 1:numel(PD_adpt)    
    xlswrite(Fnane,PD_adpt{ii},'sheet',sheet_names(ii))
end
3 comentarios
Respuestas (1)
  Dave B
    
 el 4 de Nov. de 2021
        
      Editada: Dave B
    
 el 5 de Nov. de 2021
  
      xlswrite(Fnane, PD_adpt{ii}, sheet_names(ii))
But in general you might have a better time if you use writematrix/writecell/writetable instead of xlswrite
0 comentarios
Ver también
Categorías
				Más información sobre Spreadsheets en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


