Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Carter68
 
Posts: n/a
Default 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   Report Post  
Bob Phillips
 
Posts: n/a
Default


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   Report Post  
Carter68
 
Posts: n/a
Default

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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I convert a number formated as a date to text in Excel? BrotherNov Excel Discussion (Misc queries) 5 March 2nd 05 03:51 PM
Sort or Filter option? Mcobra41 Excel Worksheet Functions 3 February 23rd 05 07:22 PM
macro to Find Replace in Excel Nurddin Excel Discussion (Misc queries) 7 January 3rd 05 04:29 AM
How do I compare two columns on seperate sheets and replace text . hag400 Excel Worksheet Functions 1 December 28th 04 02:32 PM
Macro, select Sheet "Number", NOT Sheet Name DAA Excel Worksheet Functions 4 November 30th 04 05:29 PM


All times are GMT +1. The time now is 08:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"