Suppression d'une ligne par son numéro - pour DIOP

  • Initiateur de la discussion Initiateur de la discussion vgendron
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

vgendron

XLDnaute Barbatruc
Hello DIOP

C'est ici que ca se passe

donc, la question était:

dans une cellule A1 de la feuill1, je mets un numéro de ligne à supprimer
supprimer la dite ligne dans la feuille 2
le tout en VBA

VB:
sub sup()
numligne=sheets("Feuil1").range("A1")
sheets("Feuil2").rows(numligne).delete
end sub
 
avec ce code?
VB:
Sub Supprime_ligne_produit()
     Dim i As Long
     Dim DebTablo, LigneToSup As Integer
     With Application: .ScreenUpdating = False: .Calculation = xlManual: .EnableEvents = False: End With
     DebTablo = 97
     LigneToSup = Sheets("PARAMETRAGE STRUCTURE").Range("C6")
     Sheets("PARAMETRAGE PRODUIT").Rows(DebTablo + LigneToSup).Delete
     
     With Application: .EnableEvents = True: .Calculation = xlAutomatic: .ScreenUpdating = True: End With
'Dim rep
' rep = InputBox("Ligne à supprimer")
'If IsNumeric(rep) Then Range("A" & rep).EntireRow.Delete
End Sub
 
avec ce code?
VB:
Sub Supprime_ligne_produit()
     Dim i As Long
     Dim DebTablo, LigneToSup As Integer
     With Application: .ScreenUpdating = False: .Calculation = xlManual: .EnableEvents = False: End With
     DebTablo = 97
     LigneToSup = Sheets("PARAMETRAGE STRUCTURE").Range("C6")
     Sheets("PARAMETRAGE PRODUIT").Rows(DebTablo + LigneToSup).Delete
    
     With Application: .EnableEvents = True: .Calculation = xlAutomatic: .ScreenUpdating = True: End With
'Dim rep
' rep = InputBox("Ligne à supprimer")
'If IsNumeric(rep) Then Range("A" & rep).EntireRow.Delete
End Sub
super merci vgendron le code marche parfaitement Merci 1000 fois j ai passé deux semaines à chercher
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
5
Affichages
520
Retour