+ Reply to Thread
Results 1 to 4 of 4

Replace Number with Text using Macro

  1. #1
    Carter68
    Guest

    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. #2
    Bob Phillips
    Guest

    Re: Replace Number with Text using Macro


    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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    Carter68
    Guest

    Re: Replace Number with Text using Macro

    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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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. #4
    Bob Phillips
    Guest

    Re: Replace Number with Text using Macro

    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" <[email protected]> wrote in message
    news:uqRF%[email protected]...
    >
    > 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1