Hello! I have written a code that checks a value in one column (Column "C") and does a vlookup for corresponding values to put in other columns (Columns "AH" to "AM").
Using a For Next loop it does this until it has checked all the rows from the 3rd row to the last row with data in it.

Within the loop I have several If statements: first to check the "C" column value that I'm using to do the lookup with meets certain criteria (i.e. the cell isn't empty, and doesn't say "Product ID").
All of my code worked fine until I added a second set of criteria based on the destination cell. I don't want the code to update cells that already have a value in them, unless the value is #N/A (i.e. Error 2042).
Here is the code:

1.	Public Sub Update()
2.	Application.Cursor = xlWait
3.	Dim ttl As Integer
4.	ttl = Range("C1", Cells(Rows.Count, "C").End(xlUp)).Count 
5.	Dim n As Long
6.	For n = 3 To ttl 
7.	If Cells(n, "C").Value = Empty Then
8.	n = n + 1 
9.	ElseIf Cells(n, "C").Value = "Product ID" Then
10.	n = n + 1
11.	ElseIf Cells(n, "AH").Value = Empty Then ‘THIS IS WHERE I GET RUNTIME ERROR 13, THOUGH THIS LINE IS IDENTICAL TO LINE 7 except that “If” is “ElseIf”, and Column “C” is now Column “AH”)
12.	Cells(n, "AH") = Application.VLookup(Cells(n, "C"), Worksheets("APPLE_US").Range("A1:R4000"), 18, False)
13.	Cells(n, "AI") = Application.VLookup(Cells(n, "C"), Worksheets("APPLE_US").Range("A1:Z4000"), 23, False) 
14.	Cells(n, "AJ") = Application.VLookup(Cells(n, "C"), Worksheets("APPLE_US").Range("A1:Z4000"), 26, False) 
15.	Cells(n, "AK") = Application.VLookup(Cells(n, "C"), Worksheets("MYSPACE").Range("A1:R4000"), 18, False) 
16.	Cells(n, "AL") = Application.VLookup(Cells(n, "C"), Worksheets("MYSPACE").Range("A1:Z4000"), 23, False) 
17.	Cells(n, "AM") = Application.VLookup(Cells(n, "C"), Worksheets("MYSPACE").Range("A1:Z4000"), 26, False) 
18.	ElseIf Cells(n, "AH") = "#N/A" Then
19.	Cells(n, "AH").Value = "TEST"
20.	End If
21.	Next n
22.	Application.Cursor = xlDefault 
23.	End Sub
It seems like VBA has no problem executing code like line 7:
7.	If Cells(n, "C").Value = Empty Then
But as soon as the cell to check is the target cell and not the lookup value, it gives a Type mismatch error:

11.	ElseIf Cells(n, "AH").Value = Empty Then
The code also breaks at line 18:

18.	ElseIf Cells(n, "AH") = "#N/A" Then
Maybe that's not the problem, but that's the only thing I can see different between those very similar lines of code.

Any solutions