Forum Discussion
huskereurocat
Jun 21, 2023Copper Contributor
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 ...
- Jun 22, 2023
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
HansVogelaar
Jun 22, 2023MVP
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 Subhuskereurocat
Jun 22, 2023Copper Contributor
Outstanding! This works great and thank you for all your help!!