Read the help page on the Replace function. You will learn it takes 3 string arguments, not two.
Clean up multiple Excel Workbooks - Delete all sheets but 1 named 'xxx'
Hinks, Daniel
1
Reputation point
I have been looking for a vba code which will clean up all excel files in a specified folder.
By 'clean up', i mean i want it to be able to delete all sheets in the workbook except one named 'xxx', for all workbooks in a target folder.
I have found codes for a single instance where you have the workbook already open, but i was looking for something which would use the FileDialog application to allow the user to specify the folder containing the excel files and apply this action to all of them.
Thanks in advance for your assistance & time. Much appreciated.
Developer technologies Visual Basic for Applications
1,508 questions
1 answer
Sort by: Most helpful
-
Tom van Stiphout 1,861 Reputation points MVP Volunteer Moderator
2021-02-08T20:44:02.603+00:00