Modifier un algo

Résolu
Bonjour,
j'utilise c'est algo
il me demande la plage...
je voudrais l'imposer A2:J3000
est ce possible
Option Explicit

Const coG = 7
Const coH = 8
Const coF = 6
Const lideb = 2
Const codeb = 1

Sub sup()
Dim li As Long, co As Long, lifin As Long, cofin As Long
Application.ScreenUpdating = False
lifin = Cells(Rows.Count, codeb).End(xlUp).Row
cofin = Cells(lideb, Columns.Count).End(xlToLeft).Column
' traitement colonne G
For li = lideb To lifin
  If Cells(li, coG).Value = 0 Then
    Range(Cells(li, codeb), Cells(li, cofin)).ClearContents
  End If
Next li
' traitement colonne h
For li = lideb To lifin
  If Cells(li, coH).Value = 0 Then
    Range(Cells(li, codeb), Cells(li, cofin)).ClearContents
  End If
Next li

' traitement colonne F
For li = lideb To lifin
  If Cells(li, coF).Value <> "" Then
    If Cells(li, coF).Value < 75 Or Cells(li, coF).Value > 175 Then
      Range(Cells(li, codeb), Cells(li, cofin)).ClearContents
    End If
  End If
Next li

Dim p As Range, i As Long
Set p = Application.InputBox(Prompt:="Sélectionnez une plage", _
Title:=" Supprimer lignes vides", Type:=8)
With p
For i = .Rows.Count To 1 Step -1
If Application.CountA(.Rows(i)) = 0 Then _
.Rows(i).EntireRow.Delete 'ICI
Next i
End With
End Sub


Configuration: Windows / Edge 101.0.1210.47


vous êtes super!
merci à tous

5 réponses

  1. merci de ta reponse
    oui ça marche très bien mais je voudrais m'éviter de taper la plage et de l'intégrer en automatique
    a2:j3000