XL 2016 Extraction

Seddiki_adz

XLDnaute Impliqué
Bonjour
j'ai un classeur de deux feuil
dans la feuil3 j'ai la répartition des profs par salles/jours
je veut transmettre la répartition depuis la feuil3 (Tableau2) vers feuil1 ( Tableau1)
Merci d'avance
 

Pièces jointes

  • repartion des profs.xls
    55 KB · Affichages: 4
Solution
Bonjour

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...

vgendron

XLDnaute Barbatruc
Bonjour

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
 

Seddiki_adz

XLDnaute Impliqué
Bonjour

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
Merci
je vais essayer
 

vgendron

XLDnaute Barbatruc
il 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?
 

Seddiki_adz

XLDnaute Impliqué
il 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?
le problème dans mon fichier
feuil3
 

Pièces jointes

  • p2.png
    p2.png
    22 KB · Affichages: 22

vgendron

XLDnaute Barbatruc
De 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
 

Seddiki_adz

XLDnaute Impliqué
De 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
Merci infiniment Mr vgendron
 

Discussions similaires

Statistiques des forums

Discussions
311 720
Messages
2 081 909
Membres
101 836
dernier inscrit
karmon