I'm with Marcol here. If there were a way to run a macro that replaces any existing password with a new one, that would defy the purpose of password protection.

If you are the rightful user of the files and know the passwords, and if you want to change them, then you need to take the time to change the password on each file. One by one.
Anything else would be considered hacking and any advice on that is not supported in this forum.