VBA importer donner
bonjour
je souhaiterai sur mon fichier importer des données d'une feuil à l'autre avec des conditions
si la date de fin ou la date de finalisation n'est pas passée alors recopier les valeurs type de consigne et consigne
les ligne 20 a 29 son caché automatique si vide
j'espere etre suffisament claire
merci pour vos réponses
j'ai trouver ce code :
Dim DateConsigne As String, i As Integer
DateConsigne = Me.TextBox5
If DateConsigne = "" Then Exit Sub 'on quitte si vide
ListBox1.Clear
Set RngDate1 = F1.Range(F1.Cells(1, 2), F1.Cells(1, 2).End(xlDown))
Set RngDate2 = F1.Range(F1.Cells(1, 3), F1.Cells(1, 3).End(xlDown))
Set RngConsigne = F1.Range(F1.Cells(1, 4), F1.Cells(1, 4).End(xlDown))
For i = 2 To RngDate1.Count
If DateConsigne <> "" Then
MsgBox RngDate1.Item(i).Value & vbCrLf & RngDate2.Item(i).Value
If Format(DateConsigne, "00000") >= Format(RngDate1.Item(i).Value, "00000") And Format(DateConsigne, "00000") <= Format(RngDate2.Item(i).Value, "00000") _
And F1.Cells(i, 8).Value = "" Then
'Ajoute y ce que tu souhaites, avec la forme que tu souhaites !
ListBox1.AddItem (RngDate1.Item(i).Value)
ListBox1.List(ListBox1.ListCount - 1, 1) = (RngDate2.Item(i).Value)
ListBox1.List(ListBox1.ListCount - 1, 2) = (RngConsigne.Item(i).Value)
ListBox1.List(ListBox1.ListCount - 1, 3) = F1.Range("E" & i)
ListBox1.List(ListBox1.ListCount - 1, 4) = F1.Range("F" & i)
ListBox1.List(ListBox1.ListCount - 1, 5) = F1.Range("G" & i)
ListBox1.List(ListBox1.ListCount - 1, 6) = F1.Range("H" & i)
ListBox1.List(ListBox1.ListCount - 1, 7) = F1.Range("A" & i)
End If
End If
Next i
mais je n'arrive pas a l'adapter pour moi, suis je sur la bonne voie ? merci