VBA - if then imbriqué

Bonjour,

J'aimerais effectuer ceci via une macro VBA pour effectuer ce que vous voyez ci-dessous.

macro

Pourriez vous m'aider svp ? Un détail important : je ne voudrais conserver que la dernière colonne, avec les "vrai" et "faux". C'est à dire avoir ceci.

macro2

Cordialement

133macro.xlsx (12.52 Ko)

bonjour,

une proposition de macro,

Sub aargh()
    dl = Cells(Rows.Count, 1).End(xlUp).Row + 1
    For i = 2 To dl
        If Cells(i, 1) <> k Then
            If i > 2 Then Cells(i - 1, 3) = dltf
            dltf = True
            k = Cells(i, 1)
        End If
        If i < dl Then Cells(i, 3) = False
        If Application.WorksheetFunction.IsNA(Cells(i, 2)) Then dltf = False
    Next i
End Sub
195macro.xlsm (12.46 Ko)

Ok je teste ça immédiatement

Merci

Ok merci.

Ca marche nickel.

J'ai pas tout tout pigé au code, faudrait que je le décompose tranquillement mais en tout cas ça marche bien.

Rechercher des sujets similaires à "vba then imbrique"