Forum Discussion

huskereurocat's avatar
huskereurocat
Copper Contributor
Jun 21, 2023
Solved

Is an IF statment the best for this situation?

I've been trying to think of a way to write an IF statement, but am having a hard time understanding how to make this work. I have two columns of information so I hope that makes this easier. In the ...
  • HansVogelaar's avatar
    HansVogelaar
    Jun 22, 2023

    huskereurocat 

    I think I switched the terms.

    Sub Convert()
        Dim rng As Range
        Dim typ As Range
        Dim adr As String
        Application.ScreenUpdating = False
        Set rng = Range("IO:IO").Find(What:="Scrambling", LookAt:=xlWhole)
        If Not rng Is Nothing Then
            adr = rng.Address
            Do
                Set typ = Range("KA" & rng.Row)
                If typ.Value = "QB_Scrambler" Then
                    typ.Value = "QB_Improviser"
                End If
                Set rng = Range("IO:IO").Find(What:="Scrambling", After:=rng, LookAt:=xlWhole)
                If rng Is Nothing Then Exit Do
            Loop Until rng.Address = adr
        End If
        Application.ScreenUpdating = True
    End Sub