Bonjour,
Lors du lancement de mon programme, une erreur s'affiche (celle dans le titre). Quand je fais le débogage il m'affiche l'erreur à cette ligne ci dessous :
Set re = wb.Sheets("Nom").Range("f:f").Find(What:="BARRE DE RETENTION", LookAt:=xlWhole)
J'ai vu sur le forum que lorsque cette erreur s'affiche c'est parce que le nom de la feuille est mal renseigné. Pourtant, il est bien correct. Comment y remédier ?
Voici mon code en entier :
Rep = "\\NE_PAS_TOUCHER\BDD_BOM\FirstRowCentral\"
fn = Dir(Rep & "3S*.xlsx")
Do While fn <> ""
Workbooks.Open Rep & fn
fn = Dir
Loop
twb.Activate 'Active le fichier Excel actuel
With Sheets("FirstRowCentral")
If Me.CheckBox10.Value = True Then
For Each wb In Application.Workbooks
If InStr(wb.Name, "3S") > 0 Then
Set re = wb.Sheets("Nom").Range("f:f").Find(What:="JOINT TORIQUE", LookAt:=xlWhole)
If Not re Is Nothing Then
Dim L As Long
L = Range("f65336").End(xlUp).Row + 1
.Cells(L, "D") = re.Value
Exit For
End If
End If
Next wb
End If
For Each wb In Application.Workbooks
If InStr(wb.Name, "3S") > 0 Then
wb.Close
End If
Next wb
End With