How to add data into the first row of an existing excel sheet and shift the existing data down
조회 수: 2 (최근 30일)
이전 댓글 표시
I am adding data to excel daily. Originally I would add a new row to the end to many excel files and sheets using xlswrite.
- For example: if there are 200 rows, I run the code and it adds a row in the 201st spot.
I am making plots of all of this data in the excel files/sheets but unfortunately when I add a row at the end the plots wont update. If I add a row anywhere else before the end, the plots recognize it and will update. My only job now would be to sort the data in each file/sheet vs updating various parameter ranges for every plot in each file/sheet.
- For example: I would like to add a row to A1 and shift the existing 200 rows down for a total of 201 rows.
댓글 수: 0
채택된 답변
Varun Bhaskar
2015년 8월 25일
Hi Calabrese,
This workflow is not possible with xlswrite. The workaround would be to retrieve all the rows in the Excel file into a variable in MATLAB via xlsread, then concatenate those rows to the row to be inserted right at the beginning. You can then write the whole block of data into Excel using xlswrite.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!