Do While Not (IsEmpty(ActiveCell)) If Left(Feuil1.Range("A1").Value, 2) 11 And Right(Feuil1.Range("A1").Value, 1) a Then nb = nb + 1 End If Selection.Offset.cell(1, 0).Select Loop
Sub quotass() Dim i As Integer Dim j As Integer Dim k As Integer Dim l As Integer Dim nb As Integer nb = 0 i=1 v_max = Sheets(2).Range("A1:A65536").SpecialCells(xlCellTypeLastCell).Row While (v_max >= i) If Left(Sheets(2).Range("A" & i), 2) "11" And Right(Sheets(2).Range("A" & i), 1) "a"Then nb = nb + 1 i=i+1 Wend End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDo While Not (IsEmpty(ActiveCell))
Dim nb As Integer, c As Range For Each c In Worksheets("Feuil1").Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row) If c.Text Like "11*a" Then nb = nb + 1 Next MsgBox nb