Hello !

Nom : règles.JPG
Affichages : 160
Taille : 17,7 Ko

Voici ma feuille excel "feuille1" (colonne A,B,C)!

voici une macro :
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
32
33
34
35
36
37
 
Sub validation()
Dim v As Variant
Dim var1 As Variant
Dim var2 As Variant
        For i = 19 To 999
            If (Not IsEmpty(Range("A" & i))) Then
                If (Range("B" & i) = ">") Then
                    With Worksheets("feuille1")
                        var1 = .Cells(i, 1).Value
                        var2 = .Cells(i, 3).Value
                    End With
                    Sheets.Add.Name = "test"
                    v = Application.Run("BERT.Call", "compare_sup", var1, var2)
                    ActiveSheet.Range("A1:K130000").Value = v
                End If
                If (range("B" & i) = "<") Then
                    With Worksheets("feuille1")
                        var1 = .Cells(i, 1).Value
                        var2 = .Cells(i, 3).Value
                    End With
                    Sheets.Add.Name = "test"
                    v = Application.Run("BERT.Call", "compare_inf", var1, var2)
                    ActiveSheet.Range("A1:K130000").Value = v
                End If
                If (range("B" & i)  = "=") Then
                    With Worksheets("feuille1")
                        var1 = .Cells(i, 1).Value
                        var2 = .Cells(i, 3).Value
                    End With
                    Sheets.Add.Name = "test"
                    v = Application.Run("BERT.Call", "compare_egal", var1, var2)
                    ActiveSheet.Range("A1:K130000").Value = v
                End If
            End If
        Next i
End Sub
Je souhaiterai effectuer cette macro pour les lignes de l'image, l'application v retourne deux colonnes ID et RG (chaque instance v le retourne l'id).


Je dois modifier cette ligne en précisant ActiveSheet.Range("A1:K130000").Value = v en faisant varier la colonne

Je souhaiterai modifier cette macro pour avoir un tableau dans la feuille test avec
ID RG_1 RG_2

Merci!