qui m'emmennerait directement sur les cellules qui ne sont pas égale à zéro.
Private Sub CommandButton1_Click() Dim i As Integer, a_traiter As Range, alors As String, c As Range '--------------- dans cet exemple, on choisit de traiter les lignes 4 à 20 de la colonne A -------------------- For i = 4 To 20 If Range("A" & i).Value = "0" Then If a_traiter Is Nothing Then Set a_traiter Range("A" & i) Else Set a_traiter Application.Union(a_traiter, Range("A" & i)) End If Next If Not a_traiter Is Nothing Then For Each c In a_traiter c.Activate alors = InputBox("combien, alors ?") ' à toi d'améliorer cet inputbox à TA sauce (quand-même !) c.Value = alors Next End If End Sub
Private Sub CommandButton1_Click() Dim i As Integer, alors As String, c As Range, ou As Integer '--------------- dans cet exemple, on choisit de traiter les lignes 4 à 20 de la colonne A -------------------- With Range("A4:A20") Set c = .Find("0", LookIn:=xlValues) If Not c Is Nothing Then ou = c.Row Do c.Activate alors = InputBox("combien, alors ?") ' à toi d'améliorer cet inputbox à TA sauce (quand-même !) c.Value = IIf(alors <> "", alors, c.Value) Set c = .FindNext(c) If Not c Is Nothing Then If c.Row < ou Then Exit Do End If Loop Until c Is Nothing End If End With End Sub
Set c = .Find("0", LookIn:=xlValues)
Set c = .Find("0", LookIn:=xlValues, lookat:=xlWhole)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question