Hello,
I am using this code
Sub NFMove()
Dim LastRow As Integer, i As Integer
Dim Rng As Range, Cel As Range
Dim BT1 As String, BT2 As String
With Sheets("Tracer List")
BT1 = "ANF"
BT2 = "JNF"
LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
Set Rng = .Range("A3:A" & LastRow)
For Each Cel In Rng
If Cel.Value = BT1 Or BT2 Then 'Gives me error 13 here.
MsgBox "Working", vbOKOnly
End If
Next Cel
End With
End Sub
And the area marked is giving me a type mismatch. Not sure why. I've tried changing it to these:
If Cel.Value = "ANF" or "JNF"
If Range("A" & cel.row).value = BT1 Or BT2 Then
Both give me the same error. I use this in another sub and it works just fine:
If Range("A" & y + 3).Value = FullLoc(z) Then
Range("A" & y + 3) = LocCode(z)
What it does: This code moves through a range and checks to see if the value in Column A is ANF or JNF, and if it is, it presents a message box.
if anyone could point out a mistake I've made somewhere in there (that is the full sub) I would appreciate it.
Bookmarks