XL 2013 matrice de formation

RomainPOIRET

XLDnaute Occasionnel
Bonjour à vous tous,

J'ai un petit soucis,

J'ai une matrice de compétences avec du personnel en ligne et des compétences en colonnes

j'ai un userform qui me propose un nom, une fois valider, une nouvelle page s'affiche "Formation_(NOM)"
Je souhaiterai qu'il n'y ai que le nom de la personne en question et que les compétences à niveau 0, on supprime les lignes et colonnes inutiles, voilà ...

Je n'y arrive malheureusement pas, pouvez-vous m'aider ?

D'avance merci,

Romain
 

Pièces jointes

  • TEST.xlsm
    40.7 KB · Affichages: 27
Solution
Bonjour Romain,
En PJ un essai avec :
VB:
' Rechercher la personne sélectionnée
Application.ScreenUpdating = False
With Sheets("Formation_" & ComboBox1.Value)
    ' Suppression des lignes superflues
    derlig = .Range("F65500").End(xlUp).Row
    For i = derlig To 4 Step -1
        If Range("B" & i).Value <> ComboBox1.Value Then
            Range("B" & i).EntireRow.Delete
        End If
    Next i
    ' Suppression des colonnes superflues
    dercol = 1 + Application.CountIf(Range("3:3"), "*")
    For i = dercol To 6 Step -1
        If Cells(4, i) <> 0 Then
            Columns(i).Delete Shift:=xlToLeft
        End If
    Next i
End With

sylvanu

XLDnaute Barbatruc
Supporter XLD
Bonjour Romain,
En PJ un essai avec :
VB:
' Rechercher la personne sélectionnée
Application.ScreenUpdating = False
With Sheets("Formation_" & ComboBox1.Value)
    ' Suppression des lignes superflues
    derlig = .Range("F65500").End(xlUp).Row
    For i = derlig To 4 Step -1
        If Range("B" & i).Value <> ComboBox1.Value Then
            Range("B" & i).EntireRow.Delete
        End If
    Next i
    ' Suppression des colonnes superflues
    dercol = 1 + Application.CountIf(Range("3:3"), "*")
    For i = dercol To 6 Step -1
        If Cells(4, i) <> 0 Then
            Columns(i).Delete Shift:=xlToLeft
        End If
    Next i
End With
 

Pièces jointes

  • TEST (4).xlsm
    60.2 KB · Affichages: 21

sylvanu

XLDnaute Barbatruc
Supporter XLD
Bonjour Fpav,
Dans l'état la PJ #2 marche.
Y avez vous apporté des modifs ?
Avez vous utilisé un nom de la liste dans Combox et non un nom écrit "à la min" ?
Essayez de fournir un fichier test représentatif, si ce n'est pas celui d'origine, pour chercher d'où ça pourrait venir.
 

Statistiques des forums

Discussions
312 207
Messages
2 086 247
Membres
103 163
dernier inscrit
Pelaez