choubix
07-10-2008, 02:33 AM
hello, in the following code the line with the Match function reutrns an error (object is not set)
I suspect the wsSecurities to be "guilty" for this...
wsSecurities est Set dans ThisWorkbook / Open being
workbooks("myworkbook.xls").worksheets("Securities")
For i = LBound(aSecurities, 1) To UBound(aSecurities, 1)
Control = aSecurities(i, 3)
Duplicates = Application.WorksheetFunction.Match(Control, wsSecurities.Columns("D:D"), 0)
If Duplicates > 0 Then
MsgBox ok! 'will copy the data stored in the array in the database
On Error Resume Next 'go to next iteration
End If
Next i
what i am trying to achieve here: if Duplicates returns a value then I won't insert the data from this array into the database and proceed to the next one.
any idea ?
thx!
I suspect the wsSecurities to be "guilty" for this...
wsSecurities est Set dans ThisWorkbook / Open being
workbooks("myworkbook.xls").worksheets("Securities")
For i = LBound(aSecurities, 1) To UBound(aSecurities, 1)
Control = aSecurities(i, 3)
Duplicates = Application.WorksheetFunction.Match(Control, wsSecurities.Columns("D:D"), 0)
If Duplicates > 0 Then
MsgBox ok! 'will copy the data stored in the array in the database
On Error Resume Next 'go to next iteration
End If
Next i
what i am trying to achieve here: if Duplicates returns a value then I won't insert the data from this array into the database and proceed to the next one.
any idea ?
thx!