Merci galougalou,
voici mon code, qui fonctionne parfaitement, mais a l'exécution un peu longue….
Peut-être une idée pour réduire le temps de traitement?
Sub Edition_bordereaudecollecte()
Dim Pro As Range
Dim cell As Range
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Application.Calculation = xlManual
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False
Set Pro = Range("A2:A1000")
For Each cell In Pro
cell = LCase(cell)
Next
Sheets("bordereau de collecte").Select
LI = Sheets("piquage").Cells(15000, 1).End(xlUp).Row
Sheets("bordereau de collecte").Select
Sheets("bordereau de collecte").Range("A5:AX10000").ClearContents
Calculate
Ligne = 5
For i = 2 To LI
If UCase(Sheets("piquage").Range("A" & i)) <> "" Then
Cells(Ligne, 1) = Sheets("piquage").Cells(i, 1)
Cells(Ligne, 2) = Sheets("piquage").Cells(i, 4)
Cells(Ligne, 3) = Sheets("piquage").Cells(i, 5)
Cells(Ligne, 4) = Sheets("piquage").Cells(i, 2)
Cells(Ligne, 5) = Sheets("piquage").Cells(i, 7)
Cells(Ligne, 8) = "production"
Cells(Ligne, 9) = "PDI Classique(orphelin)"
Cells(Ligne, 10) = "Entrée libre"
Cells(Ligne, 16) = Sheets("piquage").Cells(i, 12)
Cells(Ligne, 17) = Sheets("piquage").Cells(i, 13)
'Cells(Ligne, 21) = Sheets("piquage").Cells(i, 16)
If Sheets("piquage").Cells(i, 11) = "1" Then
Cells(Ligne, 47) = "1"
Else: Cells(Ligne, 41) = "1"
End If
If Sheets("piquage").Cells(i, 12) = "" And Sheets("piquage").Cells(i, 12) = "" Then
Cells(Ligne, 11) = "Limite Voirie"
Else: Cells(Ligne, 11) = "Dans la propriété"
End If
If Sheets("piquage").Cells(i, 6) = "0" Then
Cells(Ligne, 21) = "0"
Else: Cells(Ligne, 21) = "1"
End If
If Sheets("piquage").Cells(i, 6) = "1" Then
Cells(Ligne, 22) = "1"
Else: Cells(Ligne, 22) = "0"
End If
If Sheets("piquage").Cells(1, 1) = "saint barthelemy" Then
Cells(Ligne, 24) = "5615003"
End If
End If
Range("A5:A65000").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Ligne = Ligne + 1
Next
'End If
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
Application.Calculation = xlAutomatic
Application.EnableEvents = True
ActiveSheet.DisplayPageBreaks = True
Call Mise_en_forme
End Sub
Cordialement,
ERIC