Bonsoir gmb,
Cela fonctionne bien sauf quand je souhaite copier le code sur mon fichier initial ou quand je souhaite copier mes données dna sle fichier que tu m'as transmis.
J'ai désactivé la première partie à savoir la copie dans le premier tableau pour lequel je n'ai plus d'utilité. Cela fonctionne bien mais c'est après quand je copie mes données que cela ne fonctionne plus.
J'ai le message : Erreur d'éxécution '91' Variable objet ou variable de bloc With non définie.
Le code:
Option Explicit
Private Sub CmbAnnuler_Click()
Unload Me
End Sub
Private Sub CmbValider_Click()
Dim dte1$, dte2, dte3, derCol, cell As Range, col, ln, lgn, coln, plage
'dte1 = Left(CbbMois.Value, 3) & "-" & Right(CbbAnnee, 2)
'dte2 = Left(CbbMois.Value, 4) & "-" & Right(CbbAnnee, 2)
dte3 = DateSerial(CbbAnnee, CbbMois.ListIndex + 1, 1)
'Set cell = Rows("13:13").Find(dte1, lookat:=xlWhole)
'If Not cell Is Nothing Then
' col = cell.Column
'Else
' Set cell = Rows("13:13").Find(dte2, lookat:=xlWhole)
' If Not cell Is Nothing Then
' col = cell.Column
' Else
' MsgBox "La date " & CbbMois & "-" & CbbAnnee & " ne figure pas sur la ligne 13", 16
' Exit Sub
' End If
'End If
Set cell = Range("A14:A" & Range("A" & Rows.Count).End(xlUp).Row).Find(dte3, lookat:=xlWhole)
If Not cell Is Nothing Then
ln = cell.Row
Else
MsgBox "La date " & CbbMois & "-" & CbbAnnee & " ne figure pas sur la colonne A", 16
Exit Sub
End If
For Each cell In Range("plage")
'lgn = Range("A14:A30").Find(cell, lookat:=xlWhole).Row
'Cells(lgn, col) = cell.Offset(1, 0)
coln = Range("B13:R13").Find(cell, lookat:=xlWhole).Column <<< ca bug ici...
Cells(ln, coln) = cell.Offset(1, 0)
Next cell
MsgBox "Travail terminé."
'MsgBox "La ligne que vous avez définie est :" & Chr(13) & "* à la colonne " & col & _
" sur la ligne 13" & Chr(13) & "* à la ligne " & ln & " sur la colonne A"
End Sub
Tu pourrais m'aider???
Je te remercie beaucoup
Cordialement,