Hi,
I am trying to make the following code work in excel VBA.
I can understand length of b() is different then a() that is why my code gives me an error but I dont know how to fix it. Any help is very much appriciated.
Thanks,
I am trying to make the following code work in excel VBA.
VBA Code:
Sub TESTCASE()
Dim i, x, lr As Long
Dim a(), b(), c(), d(), e() As Variant
Set MT = Sheets("Mortgage")
With MT
lr = .Range("A" & Rows.Count).End(3).Row
a = .Range("J2:J" & lr).Value
c = .Range("K2:K" & lr).Value
b = .Range("M2:M9").Value
.Range("K2:K" & lr).ClearContents
For i = 1 To UBound(a)
If UCase(a(i, 1)) = UCase(b(i, 1)) Then c(i, 1) = "APOD"
Next
.Range("K2").Resize(UBound(c)).Value = c
End With
End Sub
I can understand length of b() is different then a() that is why my code gives me an error but I dont know how to fix it. Any help is very much appriciated.
Thanks,