On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.
Become a Premium Member and unlock a new, free course in leading technologies each month.
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Public Sub DoStuff()
Dim a&, n&, t, t2
ActiveSheet.UsedRange
n = ActiveSheet.UsedRange.Row + ActiveSheet.UsedRange.Rows.Count - 1
For a = 3 To n
t = Cells(a, 2)
If t <> "" Then
Cells(a, 20).FormulaR1C1 = "=isna(vlookup(rc2,c35,1,false))"
If Not Cells(a, 20) Then
Cells(a, 20) = t
Cells(a, 20).Interior.Color = RGB(146, 208, 80)
Else
Cells(a, 20) = "ERROR"
Cells(a, 20).Interior.Color = RGB(255, 0, 0)
End If
End If
Next a
End Sub
Public Sub DoStuff()
Dim a&, n&, t, t2
ActiveSheet.UsedRange
n = ActiveSheet.UsedRange.Row + ActiveSheet.UsedRange.Rows.Count - 1
For a = 3 To n
t = Cells(a, 2)
If t <> "" Then
Cells(a, 20).NumberFormat = "General"
Cells(a, 20).FormulaR1C1 = "=isna(vlookup(rc2,c35,1,false))"
If Not Cells(a, 20) Then
Cells(a, 20) = t
Cells(a, 20).Interior.Color = RGB(146, 208, 80)
Else
Cells(a, 20) = "ERROR"
Cells(a, 20).Interior.Color = RGB(255, 0, 0)
End If
End If
Next a
End Sub
I added line 8 which fixes it.If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.