Is there a way to run the codes below on every sheet in my workbook? I have 50+ sheets (tab1, tab2, tab3... tab50...) I musto to change column B and X to upper case and after do action find and replace. I using 2 macros, 1st is for change case to upper case, 2nd for find EXAMPLE 1 and replace with EXAPLE 2.
<code style="margin: 0px; padding: 0px; font-style: inherit;">Sub vs()
Dim Rng As Range
On Error Resume Next
Err.Clear
Application.EnableEvents = False
For Each Rng In Selection.SpecialCells(xlCellTypeConstants, _
xlTextValues).Cells
If Err.Number = 0 Then
Rng.Value = StrConv(Rng.Text, vbUpperCase)
' Rng.Value = StrConv(Rng.Text, vbLowerCase)
' Rng.Value = StrConv(Rng.Text, vbProperCase)
End If
Next Rng
Application.EnableEvents = True
End Sub
******AND SECOND MACRO****
ublic Sub Priority()
Dim s as String
Dim cell as Range
For Each cell In Selection
s = cell.Text
select case s
case "R. FC BARCELONA"
Cell.Value = "BARCELONA"
case "VALENCIA B.C."
Cell.Value = "PAMESA"
case "GRAN CANARIA 2014"
Cell.Value = "GRAN CANARIA"
case "B. BILBAO BASKET"
Cell.Value = "BILBAO"
End Select
Next cell
End Sub
</code>
<code style="margin: 0px; padding: 0px; font-style: inherit;">Sub vs()
Dim Rng As Range
On Error Resume Next
Err.Clear
Application.EnableEvents = False
For Each Rng In Selection.SpecialCells(xlCellTypeConstants, _
xlTextValues).Cells
If Err.Number = 0 Then
Rng.Value = StrConv(Rng.Text, vbUpperCase)
' Rng.Value = StrConv(Rng.Text, vbLowerCase)
' Rng.Value = StrConv(Rng.Text, vbProperCase)
End If
Next Rng
Application.EnableEvents = True
End Sub
******AND SECOND MACRO****
ublic Sub Priority()
Dim s as String
Dim cell as Range
For Each cell In Selection
s = cell.Text
select case s
case "R. FC BARCELONA"
Cell.Value = "BARCELONA"
case "VALENCIA B.C."
Cell.Value = "PAMESA"
case "GRAN CANARIA 2014"
Cell.Value = "GRAN CANARIA"
case "B. BILBAO BASKET"
Cell.Value = "BILBAO"
End Select
Next cell
End Sub
</code>