Replace Number with Text using Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need help replacing a number with text using a Macro.

For example: I need to replace numbers in Column B with text

Replace 212 with "Sike Branch Manager"
Replace 154 with "So County Manager"
Replace 188 with "Bridge Manager"

Any help would be greatly appreciated.
 
Sub ReplaceEm()
Dim iLastRow As Long
Dim i As Long

iLAstRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
WIth Cells(i,"A").
Select Case Value
Case 212 : .Value = "Sike Branch Manager"
Case 154 : .Value = "So County Manager"
Case 188 : .Value = "Bridge Manager"
'etc
End Select
End With
Next i
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Typo

Sub ReplaceEm()
Dim iLastRow As Long
Dim i As Long

iLAstRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To iLastRow
WIth Cells(i,"A")
Select Case .Value
Case 212 : .Value = "Sike Branch Manager"
Case 154 : .Value = "So County Manager"
Case 188 : .Value = "Bridge Manager"
'etc
End Select
End With
Next i
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top