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

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
 

vgendron

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

DIOP

XLDnaute Nouveau
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
 

Discussions similaires

Réponses
3
Affichages
568

Statistiques des forums

Discussions
312 092
Messages
2 085 223
Membres
102 826
dernier inscrit
ag amestan