Sub ventiler()
With Sheets("Feuil3")
tabdata = .Range("D1:X15").Value
End With
For i = LBound(tabdata, 1) + 1 To UBound(tabdata, 1)
For j = LBound(tabdata, 2) + 1 To UBound(tabdata, 2)
ListeProfs = Split(tabdata(i, j), " et ")
For Each prof In ListeProfs
With Sheets("Feuil1")
Set trouve = .Range("A:A").Find(prof, lookat:=xlWhole)
If Not trouve Is Nothing Then
ligne = trouve.Row
End If
Set trouve = .Rows("1:1").Find(tabdata(i, 1), lookat:=xlWhole)
If Not trouve Is Nothing Then
colonne = trouve.Column
End If...
Sub ventiler()
With Sheets("Feuil3")
tabdata = .Range("D1:X15").Value
End With
For i = LBound(tabdata, 1) + 1 To UBound(tabdata, 1)
For j = LBound(tabdata, 2) + 1 To UBound(tabdata, 2)
ListeProfs = Split(tabdata(i, j), " et ")
For Each prof In ListeProfs
With Sheets("Feuil1")
Set trouve = .Range("A:A").Find(prof, lookat:=xlWhole)
If Not trouve Is Nothing Then
ligne = trouve.Row
End If
Set trouve = .Rows("1:1").Find(tabdata(i, 1), lookat:=xlWhole)
If Not trouve Is Nothing Then
colonne = trouve.Column
End If
.Cells(ligne, colonne) = tabdata(1, j)
End With
Next prof
Next j
Next i
End Sub
MerciBonjour
un essai avec cette macro
VB:Sub ventiler() With Sheets("Feuil3") tabdata = .Range("D1:X15").Value End With For i = LBound(tabdata, 1) + 1 To UBound(tabdata, 1) For j = LBound(tabdata, 2) + 1 To UBound(tabdata, 2) ListeProfs = Split(tabdata(i, j), " et ") For Each prof In ListeProfs With Sheets("Feuil1") Set trouve = .Range("A:A").Find(prof, lookat:=xlWhole) If Not trouve Is Nothing Then ligne = trouve.Row End If Set trouve = .Rows("1:1").Find(tabdata(i, 1), lookat:=xlWhole) If Not trouve Is Nothing Then colonne = trouve.Column End If .Cells(ligne, colonne) = tabdata(1, j) End With Next prof Next j Next i End Sub
voila ça marche très bienMerci
je vais essayer
le problème dans mon fichieril y a un problème dans ton ficher
Feuil3, lundimatin1: les profs 10 11 12 sont en salle 1 ET en salle 16
==> ma macro place bien les profs en salle 1, mais ensuite, elle ecrase pour mettre en salle 16==> il y a donc perte d'info
tu dis, "il y a un problème, il me double les résultats".. c'est qui il??
ou ca des résultats en double?
Merci infiniment Mr vgendronDe ce que je vois, le "problème" vient de ta macro déjà présente. qui remplit la feuille 3
ta demande n'est pas de corriger cette macro, mais d'en avoir une autre qui remplit la feuill1 à partir de la 3
depuis quelques temps, tu multiplies les posts, aucun n'est très clair.. d'ou le peu de réponse que tu as.
il faut faire un effort sur les explications: de quoi tu pars, ce que tu veux obtenir, et de quelle manière