Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
dim ws as worksheet, i as integer, b as string
for each ws in worksheets
with ws
if .name like "*MR*" then
for i = 1 to len(.name)-1
if mid(.name, i,2)="MR" and not mid(.name, i,3)="MRS" then
.name = left(.name,i+1) & "S" & mid(.name, i+2)
exit for
end if
next
end if
end with
next
Sub zero()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If InStr(1, UCase(ws.Name), "MR") > 0 And _
(InStr(1, UCase(ws.Name), "MR") <> InStr(1, UCase(ws.Name), "MRS")) Then
If UCase(ws.Name) = ws.Name Then
ws.Name = WorksheetFunction.Substitute(ws.Name, "MR", "MRS")
Else
ws.Name = WorksheetFunction.Substitute(ws.Name, "mr", "mrs")
End If
End If
Next
End Sub