Modification d'un code VB redefinir un ordre

bellenm

XLDnaute Impliqué
Bonjours à tous,

question simple dans une variable peux t'on changer le 1er chiffre du "1" au "3", le deuxième en "2" en "4" et le troisième de "3" en "5"
1575727951482.png
puisque c'est pour trois autres équipes la 3, 4 et 5

Voici la variable qui se trouve dans une macro qui recherche les clubs chois par équipe et qui les restitue sous forme de tableau.
VB:
Sub Tri_liste_Adversaire()
'
If MsgBox("Avez-vous enlever la protection sur la feuille ""DONNEES LIS"". Voulez-vous continuez ?", vbQuestion + vbYesNo, "QUESTION ...") = vbYes Then
  '
Dim a, b(), i As Long, j As Byte, x As Long, n As Long
    With Sheets("DONNEES LIS").Range("j1").CurrentRegion
        a = .Value
        x = Application.Count(.Columns("f:i").Cells)
    End With
    ReDim b(1 To x, 1 To 4)
    For j = 6 To UBound(a, 2)
        For i = 2 To UBound(a, 1)
            If a(i, j) = 1 Then
                n = n + 1
                b(n, 1) = j - 5
                b(n, 2) = a(i, 2)
                b(n, 3) = a(i, 5)
                b(n, 4) = a(i, 4)
            End If
        Next
    Next
    With Sheets("ADVERSAIRES").Cells(1)
        '.Cells.Clear
       .Resize(1, UBound(b, 2)).Value = Array("Equipe", "Club", _
                                               "Dérogation", "Local")
        .Offset(1).Resize(n, UBound(b, 2)).Value = b
        With .CurrentRegion
            .Font.Name = "calibri"
            .BorderAround Weight:=xlThin
            .Borders(xlInsideVertical).Weight = xlThin
            .VerticalAlignment = xlCenter
            With .Rows(1)
                .HorizontalAlignment = xlCenter
                .Interior.ColorIndex = 40
                .Font.Bold = True
                .BorderAround Weight:=xlThin
            End With
            '.Columns.AutoFit
       End With
    End With
  End If
End Sub


Merci pour votre collaboration .

Marc B
 

Discussions similaires

Réponses
11
Affichages
286
Réponses
5
Affichages
181