Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Replace Number with Text using Macro
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. |
#2
|
|||
|
|||
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) "Carter68" wrote in message ... 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. |
#3
|
|||
|
|||
I am getting a compile error with this line.........
With Cells(i,"A") "Bob Phillips" wrote: 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) "Carter68" wrote in message ... 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. |
#4
|
|||
|
|||
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) "Bob Phillips" wrote in message ... 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) "Carter68" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I convert a number formated as a date to text in Excel? | Excel Discussion (Misc queries) | |||
Sort or Filter option? | Excel Worksheet Functions | |||
macro to Find Replace in Excel | Excel Discussion (Misc queries) | |||
How do I compare two columns on seperate sheets and replace text . | Excel Worksheet Functions | |||
Macro, select Sheet "Number", NOT Sheet Name | Excel Worksheet Functions |