luke3300
XLDnaute Impliqué
Bonjour à tout le forum,
voilà, il y a quelques temps, vous m'avez aidé pour créer un fichier et dans celui-ci, il y a un code que voici:
Sub totaux()
Dim tablo As Variant
Dim i As Long, j As Byte, k As Long, s As Byte
Dim PremLig As Long, DerLig As Long, DerLig2 As Long
For s = 1 To 4
With Sheets(s)
PremLig = .Columns("A:A").Find(What:="Sce", LookAt:=xlWhole).Row + 1
DerLig = .Columns("A:F").Find(What:="Remplaçants", LookAt:=xlWhole).Row - 1
DerLig2 = .Columns("A:A").Find(What:="Total", LookAt:=xlWhole).Row - 2
tablo = .Range(.Cells(PremLig, 1), .Cells(DerLig, 32))
For i = DerLig + 2 To DerLig2 Step 2
For j = 5 To 31
If .Cells(i, j) <> "" Then
For k = 1 To UBound(tablo)
If tablo(k, 1) = .Cells(i, j) Then
tablo(k, UBound(tablo, 2)) = tablo(k, UBound(tablo, 2)) + .Cells(i + 1, j)
End If
Next k
End If
Next j
Next i
For i = 1 To UBound(tablo)
Sheets("Totaux").Cells(i + 2, s + 10) = tablo(i, UBound(tablo, 2))
Next i
Erase tablo
End With
Next s
Ce code fonctionne parfaitement sous excel 2003 mais quand je l'utilise sur excel 2007, il m'affiche un déboggage pour cette ligne:
PremLig = .Columns("A:A").Find(What:="Sce", LookAt:=xlWhole).Row + 1
Evidement ça bloque le bon déroulement du code.
Quelqu'un pourrait-il éclairer ma lanterne à ce sujet? Je précise que rien n'a été changé dans ce fichier qui je rappelle fonctionne à merveille sous excel 2003.
Un grand merci d'avance pour votre aide précieuse et surtout bonne journée à tous.
voilà, il y a quelques temps, vous m'avez aidé pour créer un fichier et dans celui-ci, il y a un code que voici:
Sub totaux()
Dim tablo As Variant
Dim i As Long, j As Byte, k As Long, s As Byte
Dim PremLig As Long, DerLig As Long, DerLig2 As Long
For s = 1 To 4
With Sheets(s)
PremLig = .Columns("A:A").Find(What:="Sce", LookAt:=xlWhole).Row + 1
DerLig = .Columns("A:F").Find(What:="Remplaçants", LookAt:=xlWhole).Row - 1
DerLig2 = .Columns("A:A").Find(What:="Total", LookAt:=xlWhole).Row - 2
tablo = .Range(.Cells(PremLig, 1), .Cells(DerLig, 32))
For i = DerLig + 2 To DerLig2 Step 2
For j = 5 To 31
If .Cells(i, j) <> "" Then
For k = 1 To UBound(tablo)
If tablo(k, 1) = .Cells(i, j) Then
tablo(k, UBound(tablo, 2)) = tablo(k, UBound(tablo, 2)) + .Cells(i + 1, j)
End If
Next k
End If
Next j
Next i
For i = 1 To UBound(tablo)
Sheets("Totaux").Cells(i + 2, s + 10) = tablo(i, UBound(tablo, 2))
Next i
Erase tablo
End With
Next s
Ce code fonctionne parfaitement sous excel 2003 mais quand je l'utilise sur excel 2007, il m'affiche un déboggage pour cette ligne:
PremLig = .Columns("A:A").Find(What:="Sce", LookAt:=xlWhole).Row + 1
Evidement ça bloque le bon déroulement du code.
Quelqu'un pourrait-il éclairer ma lanterne à ce sujet? Je précise que rien n'a été changé dans ce fichier qui je rappelle fonctionne à merveille sous excel 2003.
Un grand merci d'avance pour votre aide précieuse et surtout bonne journée à tous.