1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
num_rep = TextBox5
For Each ligne In ActiveSheet.UsedRange.Rows
If ligne.Row >= 2 Then
If Not IsEmpty(Cells(ligne.Row, 1)) Then
Line = ligne.Row
For Each colonne In ActiveSheet.UsedRange.Columns
If Not IsEmpty(Cells(2, colonne.Column)) Then
col = colonne.Column
adress_1 = Cells(Line, col).Address
For Each cell In Range(Cells(Line, col), Cells(Line + num_rep - 1, col))
If IsNumeric(cell) And Not IsEmpty(cell) And cell.Value > 0 Then
adress_2 = cell.Address
check = check_value(adress_1, adress_2) ' permet de voir si la valeur a déjà été comptabilisée
If check < 2 Then
valeur_a = cell.Value
total = find(Line, col, num_rep, valeur_a) ' permet de comptabiliser combien de fois la valeur se trouve dans le tableau
If total > 1 Then
If IsEmpty(Cells(Line + num_rep, col)) Then
Cells(Line + num_rep, col).Formula = valeur_a
Else
Cells(Line + num_rep, col).Formula = "ambiguity"
End If
End If
End If
'Cells(line + num_rep, col).Formula = valeur_a + 1
End If
Next cell
End If
Next
End If
End If
Next
End Sub |
Partager