Results 1 to 5 of 5

Select Case problem

Threaded View

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    New york
    MS-Off Ver
    Excel 2003
    Posts
    45

    Select Case problem

    Hello

    I am working on a problem where I have to search the string in column B and if it contains a value say "C21" I want column C to input "Century 21" Here is the code I have so far below. Its not adding the values to column C for me any thoughs on this?

    Sub BrandNames()
    Dim R As Integer
    R = 2
           
        Do While Not (IsEmpty(Cells(R, 2)))
            
            If InStr(1, Worksheets("REbrokerList").Cells(R, 2).Value, "C-21", vbTextCompare) Or _
             InStr(1, Worksheets("REbrokerList").Cells(R, 2).Value, "C21", vbTextCompare) Or _
             InStr(1, Worksheets("REbrokerList").Cells(R, 2).Value, "Century", vbTextCompare) <> 0 Then
                Select Case Cells(R, 2)
                Case "C21"
                Cells(R, 3) = "Century 21"
                
                Case "C-21"
                    Cells(R, 3) = "Century 21"
                Case "Century"
                    Cells(R, 3) = "Century 21"
           End Select
            End If
            R = R + 1
            Loop
    Moderators Note: Please follow forum rules and use code tags. Added for you this time, but please use them in the future…Thanks.
    Last edited by jeffreybrown; 12-27-2012 at 04:43 PM.

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