Sub Transfert_v2()
'Macro par DAN pour Gregouille le 19/09/2006
'Fil : [B]Lien supprimé[/B]
Dim i As Byte, lig As Integer, ligne As Integer
Dim ws As Worksheet, bool As Boolean
Application.ScreenUpdating = False
On Error Resume Next
lig = Sheets("Tableau").Range("A32").Row
For i = 10 To lig
If Sheets("Tableau").Range("A" & i).Value = 0 Then Sheets("mod_fich").Visible = False: End
With Sheets("mod_fich")
.Visible = True
.Copy after:=Worksheets(Worksheets.Count)
End With
For Each ws In Worksheets
a = ws.Name
If ws.Name = "fich-" & i - 9 Then bool = True
Next ws
If bool = True Then
Application.DisplayAlerts = False
Sheets(Sheets.Count).Delete
Application.DisplayAlerts = True
ElseIf bool = False Then
Sheets(Sheets.Count).Name = "fich-" & i - 9
With ActiveSheet
.Cells(3, 9) = Sheets("Tableau").Cells(i, 1).Value
.Cells(5, 9) = Sheets("Tableau").Cells(i, 2).Value
.Cells(6, 5) = Sheets("Tableau").Cells(i, 13).Value
.Cells(42, 9) = Sheets("Tableau").Cells(i, 10).Value
.Cells(13, 2) = Sheets("Tableau").Cells(i, 14).Value
.Cells(2, 9) = "num_" & i - 9
.Cells(4, 8) = Sheets("Tableau").Cells(3, 10).Value
End With
End If
bool = False
Next i
Application.ScreenUpdating = True
End Sub