abhaysanan
Board Regular
- Joined
- Jun 1, 2005
- Messages
- 95
Hi,
i have this code in vba which checks through different cells and if it has an error, it moves to the next cell, or else, it puts some data in a database. The problem I am having is that on my sheet, I see 3 different error values as can be seen in the code. Somehow my code doesnt pick them up. Does any one know if there is an ISNA thing in vba??
i have this code in vba which checks through different cells and if it has an error, it moves to the next cell, or else, it puts some data in a database. The problem I am having is that on my sheet, I see 3 different error values as can be seen in the code. Somehow my code doesnt pick them up. Does any one know if there is an ISNA thing in vba??
Code:
For j = 1 To 23
For i = 1 To 24
If (ActiveSheet.Range("Prices").Cells(i, j).Text <> "#N/A RI Tim") And _
(ActiveSheet.Range("Prices").Cells(i, j).Text <> "#N/A Trd") And _
(ActiveSheet.Range("Prices").Cells(i, j).Text <> "#N/A Sec") Then
insBlpRoot = Trim(ActiveSheet.Range("Roots").Cells(i, j).Value)
insAARoot = Trim(ActiveSheet.Range("AARoot").Cells(i, j).Value)
'inserting into the database
querystring = "INSERT INTO TradeSymb (" & _
"BLPRoot, AARoot) " & _
"VALUES ('" & insBlpRoot & "', '" & insAARoot & "')"
Set qdInsertRoots = Conn.CreateQueryDef("", querystring)
Set rsRoots = qdInsertRoots.OpenRecordset()
Else
End If
Next i
Next j