Bonsoir à tous,

Voilà, je débute en VBA (et en programmation). J'ai écrit le programme suivant pour traiter des cellules dans la même colonne... mais il ne marche pas. La dernière erreut était "out of memory".
Quelqu'un pourrait-il aider un pauvre débutant... Merci !
Voici les lignes de code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
Sub finalRefFiender()
 
Dim tableString() As Double, maxLigne As Double, j As Double, i As Double
 
maxLigne = 1
i = 1
 
If ActiveSheet.Cells(1, 1).Value <> 0 Then
        ReDim tableString(1, 1)
        tableString(1, 1) = ActiveSheet.Cells(1, 1).Value
        i = i + 1
         While Not IsEmpty(ActiveSheet.Cells(i, 1))
            For j = 1 To maxLigne
                If Cells(i, 1).Value = tableString(1, j) Then
                Exit For
                Else
                    maxLigne = maxLigne + 1
                    ReDim Preserve tableString(1, maxLigne)
                    tableString(1, maxLigne) = Cells(i, 1).Value
                End If
            Next
            Wend
 
            For j = 1 To maxLigne
        Sheets("Sheet2").Cells(j, 1).Value = tableString(1, j)
        Next
Else
End If
 
End Sub