Bonjour a tous,
Merci beaucoup pour vos réponses.
Oui effectivement, il existe plusieurs autres macro dans mon classeur. Je ne sait pas vraiment laquelle vous montrer puisqu' elles sont nombreuses.
Sinon la plus grande macro est celle qui copie les informations dans ma base de donnée et rempli une feuille sous forme de cédule de travail.
Option Explicit
Sub Suivi_BT_PROD()
Dim bScreenWasUpdating As Boolean, xlCalc As XlCalculation
bScreenWasUpdating = Application.ScreenUpdating
xlCalc = Application.Calculation
On Error GoTo ErrorHandler
Application.Calculation = xlCalculationManual
Worksheets("Suivi Bon de Travail Encours").Select
Dim iLastRow As Long
iLastRow = Cells(Rows.Count, "B").End(xlUp).Row
If iLastRow > 13 Then
Range("B14:X" & iLastRow).ClearContents
End If
Application.ScreenUpdating = False
Dim iScheduleRow As Long
iScheduleRow = 14
Dim rwGeneralProduct As ListRow
For Each rwGeneralProduct In Worksheets("OM General Produit").ListObjects(1).ListRows
If rwGeneralProduct.Range.Cells(1, 13) = [L11] Then
Dim iScheduleCol As Integer
iScheduleCol = 3
If rwGeneralProduct.Range.Cells(1, 18) = 1 Then
Cells(iScheduleRow, 2) = rwGeneralProduct.Range.Cells(1, 1)
Cells(iScheduleRow, iScheduleCol) = rwGeneralProduct.Range.Cells(1, 3)
Cells(iScheduleRow, iScheduleCol + 1) = rwGeneralProduct.Range.Cells(1, 4)
Cells(iScheduleRow, iScheduleCol + 2) = rwGeneralProduct.Range.Cells(1, 6)
Cells(iScheduleRow, iScheduleCol + 3) = rwGeneralProduct.Range.Cells(1, 16)
Cells(iScheduleRow, iScheduleCol + 4) = rwGeneralProduct.Range.Cells(1, 5)
Cells(iScheduleRow, iScheduleCol + 5) = rwGeneralProduct.Range.Cells(1, 7)
Cells(iScheduleRow, iScheduleCol + 6) = rwGeneralProduct.Range.Cells(1, 8)
Cells(iScheduleRow, iScheduleCol + 7) = rwGeneralProduct.Range.Cells(1, 23)
Cells(iScheduleRow, iScheduleCol + 8) = rwGeneralProduct.Range.Cells(1, 25)
iScheduleRow = iScheduleRow + 1
End If
End If
Next rwGeneralProduct
ErrorExit:
On Error Resume Next
Application.Calculation = xlCalc
Application.ScreenUpdating = bScreenWasUpdating
Exit Sub
ErrorHandler:
MsgBox Err.Number & vbLf & Err.Description
Resume ErrorExit
End Sub