Supprimer valeur par rapport à 2 Userform

Titoy

XLDnaute Junior
Bonjour Le forum !

Aujourd'hui, j'essai tant bien que mal de trouver une solution pour supprimer d'une feuille grâce à une valeur choisi dans des userform !

La procédure est comme suit:

Premier USF:
Demande le nom à supprimer via une listbox

si Validation :
DEuxième usF:
DEmande confirmation de la suppression, les valeurs étant afficher par le biais d'une textbox.

Du coup quand je veux supprimer, cela ne fonctionne pas

Je dois avoir un probleme entre ma listbox et ma textbox mais j'en sais pas plus !

CI-joint fichier explicatif,

Merci de votre aide

Bonne journée

Cdlmt

TITOY
 

Pièces jointes

  • titoy userform.zip
    17.1 KB · Affichages: 32
C

Compte Supprimé 979

Guest
Re : Supprimer valeur par rapport à 2 Userform

Salut Titoy,

Pas tiptop sans fichier :rolleyes: mais bon, on va essayer de t'aider

Pour ton code de suppression, est ce que ce ne serait pas plutôt ça

Code:
Sheets(" ANTILLES & GUYANE").Rows(9 + [COLOR=blue][B]UserForm1.[/B][/COLOR]ListBox1.ListIndex).Delete
Sheets(10).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(11).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(12).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(13).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(14).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(15).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(16).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(17).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(18).Rows(9 + UserForm1.ListBox1.ListIndex).Delete

"Me" fait appel à l'objet en cours donc UserForm2

A+
 

Titoy

XLDnaute Junior
Re : Supprimer valeur par rapport à 2 Userform

ah Ok !

Bas ça déjà je le savais pas ! Merci !

Par contre, du coup je dois aussi modifier userform1 et listbox1, Non ?
Est ce que je peux mettre
" UserForm2.texBox1.ListIndex"
?????

Code:
Sheets(" ANTILLES & GUYANE").Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(10).Rows(9 + [B]UserForm1[/B].[B]ListBox1[/B].ListIndex).Delete
Sheets(11).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(12).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(13).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(14).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(15).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(16).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(17).Rows(9 + UserForm1.ListBox1.ListIndex).Delete
Sheets(18).Rows(9 + UserForm1.ListBox1.ListIndex).Delete


Merci
 

Discussions similaires

Statistiques des forums

Discussions
312 229
Messages
2 086 423
Membres
103 206
dernier inscrit
diambote