MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
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
Title | # Comments | Views | Activity |
---|---|---|---|
MS Excel Vllokup or formula to see if a record exists... | 1 | 22 | |
Excel VBA - macro in one workbook with another open | 4 | 19 | |
Find and Replace Function not working in Excel | 13 | 42 | |
Copying from excel I am getting extra text | 11 | 32 |
Join the community of 500,000 technology professionals and ask your questions.