I wrote this macor below which looks at the value in column P, and then re-codes the value to something else in the same row in column T.
Ex. If P2 = Apple then T2 = Fruit
It worked somewhat - but it stopped after the first case below "Internet - Access Panel" How would I fix this code to run through every scenario below and not just stop after the first?
Thanks in advance for any input and assistance!
Ex. If P2 = Apple then T2 = Fruit
It worked somewhat - but it stopped after the first case below "Internet - Access Panel" How would I fix this code to run through every scenario below and not just stop after the first?
Thanks in advance for any input and assistance!
Code:
Sub New_Methodology_Coding()
Dim lastrow As Long, t As Long
lastrow = ActiveSheet.UsedRange.Rows.Count
For t = lastrow To 1 Step -1
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Internet - Access Panel" Then Cells(t, 20).Value = "Online"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Telephone - Consumer" Then Cells(t, 26).Value = "Telephone"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Telephone - B2B C-Level" Then Cells(t, 26).Value = "Telephone"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Internet - Other / client sup" Then Cells(t, 26).Value = "Online"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "N/A" Then Cells(t, 26).Value = "Not Specified"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Analysis" Then Cells(t, 26).Value = "Analysis"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Face-to-Face (Quantitative)" Then Cells(t, 26).Value = "F2F (Quant)"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Telephone - B2B non C-Level" Then Cells(t, 26).Value = "Telephone"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Qualitative" Then Cells(t, 26).Value = "F2F (Qual)"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Presentation" Then Cells(t, 26).Value = "Presentation"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Telephone" Then Cells(t, 26).Value = "Telephone"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "QUANtitative - Face-to-Face" Then Cells(t, 26).Value = "F2F (Quant)"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Internet - External Access Pan" Then Cells(t, 26).Value = "Online"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "QUALitative - Face-to-Face" Then Cells(t, 26).Value = "F2F (Qual)"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Mail" Then Cells(t, 26).Value = "Mail"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "Face-to-Face (Qualitative)" Then Cells(t, 26).Value = "F2F (Qual)"
End If
If Cells(t, 1).Value <> "" Then
If Cells(t, 16).Value = "NULL" Then Cells(t, 26).Value = "Not Specified"
End If
Next t
End Sub
Last edited by a moderator: