Sub MajDesPrix()
Dim CodeArt As String, Prix As String, Ligne As Long
Dim DLig As Long, Lig As Long, LigD, ShtD As Worksheet
' Empêcher le recalcul = moins long
Application.Calculation = xlCalculationManual
' avec la feuile de bgpu
With ActiveSheet
' Trouver la dernière ligne contenant un article
DLig = .Range("A" & Rows.Count).End(xlUp).Row
' Pour chaque ligne
For Lig = 5 To DLig
' Mémoriser les infos
CodeArt = .Range("A" & Lig).Value
Prix = .Range("E" & Lig).Value
' Si aucun prix
If Prix = "" Then GoTo Suite
' Pour chaque feuille
For Each ShtD In ThisWorkbook.Sheets
' Si le nom de la feuille n'est pas un de la liste
If InStr(1, "Recap", ShtD.Name) = 0 Then
' Empêcher les erreurs
On Error Resume Next
LigD = 0
' Chercher la ligne correspondante au code
Set LigD = ShtD.Range("A:A").Find(What:=CDbl(CodeArt), LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False)
On Error GoTo 0
' Si une ligne a été trouvée, on inscrit le prix
If Not LigD Is Nothing Then
Ligne = LigD.Row
Application.EnableEvents = False
ShtD.Range("E" & Ligne).Value = CDec(Prix)
Application.EnableEvents = True
End If
End If
Next ShtD
Suite:
Next Lig
End With
MsgBox "Les prix ont été mis à jour"
Application.Calculation = xlCalculationAutomatic
End Sub