Private(ou Public) Function toto (param1 as ...,param2 as ...) as ... ... ... toto = ... End Function
dernier = Range("B" & Rows.Count).End(xlUp).row
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionOption Explicit Sub antho() Dim col As Integer Dim tab_1 As Variant Dim tab_2 As Variant Dim tab_2_index As Integer Dim blow, dernier, i As Integer col = 3 tab_2_index = 0 dernier = Sheets(1).Range("C" & Rows.Count).End(xlUp).Row tab_1 = Range(Cells(3, col), Cells(dernier, col)).Value ReDim tab_2(UBound(tab_1), 1) For i = 1 To dernier - 2 blow = verif(CStr(tab_1(i)), tab_2) If blow < 0 Then tab_2(tab_2_index, 0) = Trim(tab_1(i)) tab_2(tab_2_index, 1) = 1 tab_2_index = tab_2_index + 1 Else tab_2(blow, 1) = CStr(CInt(tab_2(blow, 1)) + 1) End If Next Sheets.Add Sheets(Sheets.Count).Range(Cells(1, 1), Cells(dernier - 2, 2)).Value = tab_2 End Sub Function verif(str As String, tab_2 As Variant) As Integer Dim jeton, i As Integer jeton = -1 If IsEmpty(tab_2) Then GoTo bye For i = 1 To CInt(UBound(tab_2, 0)) If Trim(str) = Trim(tab_2(i, 0)) Then jeton = i GoTo bye End If Next bye: verif = jeton End Function