Bonjour, et merci d'avance pour votre aide, j'aimerai réaliser un tableau à partir d'un userform afin de pouvoir rentrer toutes les données de transport de l'entreprise ou j'effectue mon stage et les archiver. Jusque la ca marche plutot pas mal mais j'aimerai, sur la base d'un des fichiers qu'on peut télécharger sur votre site, afficher les données par mois grace a la date d'envoie située dans la colonne H alors que dans le fichier initial les dates etaient situées en A. Je vous copie colle le code utilisé!!! milles merci d'une pauvre brelle en excel ^^
Private Sub SpinButton1_Change()
monmois = Range("C1")
If monmois = "" Then Exit Sub
If monmois > 12 Then Exit Sub
Range("B1") = Choose(monmois, "JANVIER", "FEVRIER", "MARS", "AVRIL", "MAI", "JUIN", "JUILLET", "AOUT", "SEPTEMBRE", "OCTOBRE", "NOVEMBRE", "DECEMBRE")
Range("B1😀1").Select
col = Choose(monmois, 33, 34, 35, 36, 37, 38, 39, 40, 24, 19, 42, 44)
Selection.Interior.ColorIndex = col
Range("D24").Select
Selection.Interior.ColorIndex = col
Range("A3:M23").Select
Selection.ClearContents
With Worksheets("COST").Range("N27:N3000")
Set ladate = .Find(monmois * 1.1, LookIn:=xlValues)
If Not ladate Is Nothing Then
firstAddress = ladate.Address
Do
a = a + 1
Cells(a + 2, 1) = ladate.Offset(0, -13)
Cells(a + 2, 2) = ladate.Offset(0, -12)
Cells(a + 2, 3) = ladate.Offset(0, -11)
Cells(a + 2, 4) = ladate.Offset(0, -10)
Cells(a + 2, 5) = ladate.Offset(0, -9)
Cells(a + 2, 6) = ladate.Offset(0, -8)
Cells(a + 2, 7) = ladate.Offset(0, -7)
Cells(a + 2, 8) = ladate.Offset(0, -6)
Cells(a + 2, 9) = ladate.Offset(0, -5)
Cells(a + 2, 11) = ladate.Offset(0, -3)
Cells(a + 2, 12) = ladate.Offset(0, -2)
Cells(a + 2, 13) = ladate.Offset(0, -1)
Set ladate = .FindNext(ladate)
Loop While Not ladate Is Nothing And ladate.Address <> firstAddress
End If
End With
On Error GoTo bugg
Range("D24") = Cells(23, 4) + Cells(22, 4) + Cells(21, 4) + Cells(20, 4) + Cells(19, 4) + Cells(18, 4) + Cells(17, 4) + Cells(16, 4) + Cells(15, 4) + Cells(14, 4) + Cells(13, 4) + Cells(12, 4) + Cells(11, 4) + Cells(10, 4) + Cells(9, 4) + Cells(8, 4) + Cells(7, 4) + Cells(6, 4) + Cells(5, 4) + Cells(4, 4) + Cells(3, 4)
Range("D1").Select
Exit Sub
bugg:
Range("D1").Select
MsgBox ("Attention! à corriger sur le listing ci-dessous : il manque un montant sur le mois de : " & Range("B1"))
End Sub
Si le code vous parait familier, c'est normal j'ai juste extrapolé un fichier que j'ai télécharger sur votre forum😀😀😀😀
Merci beaucoup
Private Sub SpinButton1_Change()
monmois = Range("C1")
If monmois = "" Then Exit Sub
If monmois > 12 Then Exit Sub
Range("B1") = Choose(monmois, "JANVIER", "FEVRIER", "MARS", "AVRIL", "MAI", "JUIN", "JUILLET", "AOUT", "SEPTEMBRE", "OCTOBRE", "NOVEMBRE", "DECEMBRE")
Range("B1😀1").Select
col = Choose(monmois, 33, 34, 35, 36, 37, 38, 39, 40, 24, 19, 42, 44)
Selection.Interior.ColorIndex = col
Range("D24").Select
Selection.Interior.ColorIndex = col
Range("A3:M23").Select
Selection.ClearContents
With Worksheets("COST").Range("N27:N3000")
Set ladate = .Find(monmois * 1.1, LookIn:=xlValues)
If Not ladate Is Nothing Then
firstAddress = ladate.Address
Do
a = a + 1
Cells(a + 2, 1) = ladate.Offset(0, -13)
Cells(a + 2, 2) = ladate.Offset(0, -12)
Cells(a + 2, 3) = ladate.Offset(0, -11)
Cells(a + 2, 4) = ladate.Offset(0, -10)
Cells(a + 2, 5) = ladate.Offset(0, -9)
Cells(a + 2, 6) = ladate.Offset(0, -8)
Cells(a + 2, 7) = ladate.Offset(0, -7)
Cells(a + 2, 8) = ladate.Offset(0, -6)
Cells(a + 2, 9) = ladate.Offset(0, -5)
Cells(a + 2, 11) = ladate.Offset(0, -3)
Cells(a + 2, 12) = ladate.Offset(0, -2)
Cells(a + 2, 13) = ladate.Offset(0, -1)
Set ladate = .FindNext(ladate)
Loop While Not ladate Is Nothing And ladate.Address <> firstAddress
End If
End With
On Error GoTo bugg
Range("D24") = Cells(23, 4) + Cells(22, 4) + Cells(21, 4) + Cells(20, 4) + Cells(19, 4) + Cells(18, 4) + Cells(17, 4) + Cells(16, 4) + Cells(15, 4) + Cells(14, 4) + Cells(13, 4) + Cells(12, 4) + Cells(11, 4) + Cells(10, 4) + Cells(9, 4) + Cells(8, 4) + Cells(7, 4) + Cells(6, 4) + Cells(5, 4) + Cells(4, 4) + Cells(3, 4)
Range("D1").Select
Exit Sub
bugg:
Range("D1").Select
MsgBox ("Attention! à corriger sur le listing ci-dessous : il manque un montant sur le mois de : " & Range("B1"))
End Sub
Si le code vous parait familier, c'est normal j'ai juste extrapolé un fichier que j'ai télécharger sur votre forum😀😀😀😀
Merci beaucoup