Re, le forum, Lone-wolf
J'ai trouvé cette macro (de J.Boisgontier) mais je n'arrive pas à l'adapter à la position de mon tableau qui démarre en F32.
Par ailleurs les zéros de mon Planning me pose problème...
Sub CreeBD()
Application.ScreenUpdating = False
Set s = Sheets("Congés")
s.[A2:E1000].ClearContents
Set p = Sheets("Planning")
nbCol = 380
For ligne = 33 To 47
i = 2
Do While i <= nbCol
témoin = False
Do While p.Cells(ligne, i) = "" And i <= nbCol
If i = nbCol Then témoin = True
i = i + 1
Loop
If Not témoin Then
typeCongés = p.Cells(ligne, i)
début = p.Cells(2, i)
Do While p.Cells(ligne, i) = typeCongés And i <= nbCol
If i = nbCol Then témoin = True
i = i + 1
Loop
fin = p.Cells(2, i - 1)
ligneBD = s.[A65000].End(xlUp).Row + 1
s.Cells(ligneCongés, 1) = p.Cells(ligne, 1)
s.Cells(ligneCongés, 2) = début
s.Cells(ligneCongés, 3) = fin
s.Cells(ligneCongés, 4) = typeCongés
s.Cells(ligneCongés, 5) = fin - début + 1
End If
Loop
Next ligne
End Sub
Merci pour votre aide.
Cordialement.
Christian