
Private Sub Workbook_Open()
Call Verifica
End Sub
Sub Verifica()
Dim uRiga As Long, i As Long, percorso As String
With Worksheets("Foglio1")
If .Range("A2").Value <> "" Then
uRiga = .Range("A" & Rows.Count).End(xlUp).Row
.Range("B2:B" & uRiga).ClearContents
For i = 2 To uRiga
percorso = .Range("A" & i).Value
If Dir(percorso, vbDirectory) = "" Then
.Range("B" & i).Value = "Il percorso non esiste"
Else
.Range("B" & i).Value = "OK"
End If
Next i
End If
End With
End Sub |
