Loop through all excel file in a folder to change the spreadsheet name

Hello,
I wanted to ask how do I write a loop command that will do through all excel file in a folder and change their spreadsheet name and delete some unnecessary columns.
Detail: Each xlsx file contains 3 spreadsheets, and I wanted to change the name of all 3 spreadsheet. I also want to delete some columns in each sheet.

Answers (1)

I would recommend that you generate a getAllFiles function for your future use. There are many examples on github and stackoverflow for your reference.
Once you have the file list you can loop through the list and use activeX to modify the excel files

Products

Release

R2021a

Asked:

on 1 Nov 2021

Answered:

on 1 Nov 2021

Community Treasure Hunt

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

Start Hunting!