VBA Routine to Remove Apostrophe from Sheet Names

corollary

New Member
Joined
May 31, 2014
Messages
18
Running into problems with indirect functions and apostrophe's in a sheet name. have 30 files with ~10 sheets each - maybe 10 of the sheets total have names with an apostrophe in it.

Is there a way to run through the sheet names of a given file and remove certain characters (like, say, an apostrophe)? Or does this one have to be a manual job?

Please let me know if you can help - thanks.
 
Sub Untested()
For each sh in Sheets
Sh.Name = Application.Substitute(sh.Name,"'"," ") ' That's an apostrophe inside twp double-quotes
Next
Activeworkbook.save
End Sub
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top