I am writing a VBA code that goes through a range of cells checking if each cell has data validation (drop down menu) and if not assign one to it from a list on another sheet.
I currently have trouble with the line that checks if the current cell already has data validation. I get error 1004 "no cells were found".
Sub datavalidation()
    Dim nlp As Range
    Dim lrds As Long
    Dim wp As Double
    Dim ddrange As Range
    Sheets("DataSheet").Select
        lrds = ActiveSheet.Range("A1").Offset(ActiveSheet.rows.Count - 1, 0).End(xlUp).Row
        Set nlp = Range("I3:I" & lrds)
        For Each cell In nlp
    'error on following line
            If cell.SpecialCells(xlCellTypeSameValidation).Cells.Count < 1 Then
                wp = cell.Offset(0, -8).Value
                Set ddrange = ddrangefunc(wp)
            End If
        Next
End Sub
Any ideas? Thank you
 
     
     
     
     
     
     
     
     
    