Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

l'indice n'appartient pas à la selection(macro Isabelle)

2 réponses
Avatar
Chrisdolby
bonjour, j'ai le message "l'indice n'appartient pas à la selection" lorsque
je mets le dernier chiffre de la série, c'est à dire le "33" en [b7] dans la
macro si dessous.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$7" Then
st = Array("1", "20", "14", "31", "9", "22", "18", "29", "7", "28", "12", _
"35", "3", "26", "32", "15", "19", "4", "21", "2", "25", "17", "34", "6",
"27", _
"13", "36", "11", "30", "8", "23", "10", "5", "24", "16", "33")
p = Application.Match(CStr([b7]), st, 0)
For Each c In Range("B8:C8,B9:D9,B10:E10,B11:F11,B12:G12,B13:H13,B14:I14")
Range(c.Address) = st(p + x)
x = x + 1
If p + x = 36 Then
p = 0
x = 0
End If
Next
End If

merci pour votre aide!

Chris

2 réponses

Avatar
isabelle
bonjour Chris,

voici la correction,

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$7" Then
st = Array("1", "20", "14", "31", "9", "22", "18", "29", "7", "28", "12", _
"35", "3", "26", "32", "15", "19", "4", "21", "2", "25", "17", "34", "6", "27", _
"13", "36", "11", "30", "8", "23", "10", "5", "24", "16", "33")
p = Application.Match(CStr([b7]), st, 0)
For Each c In Range("B8:C8,B9:D9,B10:E10,B11:F11,B12:G12,B13:H13,B14:I14")
If p + x = 36 Then
p = 0
x = 0
End If
Range(c.Address) = st(p + x)
x = x + 1
Next
End If
End Sub


isabelle

bonjour, j'ai le message "l'indice n'appartient pas à la selection" lorsque
je mets le dernier chiffre de la série, c'est à dire le "33" en [b7] dans la
macro si dessous.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$7" Then
st = Array("1", "20", "14", "31", "9", "22", "18", "29", "7", "28", "12", _
"35", "3", "26", "32", "15", "19", "4", "21", "2", "25", "17", "34", "6",
"27", _
"13", "36", "11", "30", "8", "23", "10", "5", "24", "16", "33")
p = Application.Match(CStr([b7]), st, 0)
For Each c In Range("B8:C8,B9:D9,B10:E10,B11:F11,B12:G12,B13:H13,B14:I14")
Range(c.Address) = st(p + x)
x = x + 1
If p + x = 36 Then
p = 0
x = 0
End If
Next
End If

merci pour votre aide!

Chris


Avatar
Chrisdolby
Impeccable comme toujours!
Merci encore!

Chris


bonjour Chris,

voici la correction,

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$7" Then
st = Array("1", "20", "14", "31", "9", "22", "18", "29", "7", "28", "12", _
"35", "3", "26", "32", "15", "19", "4", "21", "2", "25", "17", "34", "6", "27", _
"13", "36", "11", "30", "8", "23", "10", "5", "24", "16", "33")
p = Application.Match(CStr([b7]), st, 0)
For Each c In Range("B8:C8,B9:D9,B10:E10,B11:F11,B12:G12,B13:H13,B14:I14")
If p + x = 36 Then
p = 0
x = 0
End If
Range(c.Address) = st(p + x)
x = x + 1
Next
End If
End Sub


isabelle

bonjour, j'ai le message "l'indice n'appartient pas à la selection" lorsque
je mets le dernier chiffre de la série, c'est à dire le "33" en [b7] dans la
macro si dessous.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$7" Then
st = Array("1", "20", "14", "31", "9", "22", "18", "29", "7", "28", "12", _
"35", "3", "26", "32", "15", "19", "4", "21", "2", "25", "17", "34", "6",
"27", _
"13", "36", "11", "30", "8", "23", "10", "5", "24", "16", "33")
p = Application.Match(CStr([b7]), st, 0)
For Each c In Range("B8:C8,B9:D9,B10:E10,B11:F11,B12:G12,B13:H13,B14:I14")
Range(c.Address) = st(p + x)
x = x + 1
If p + x = 36 Then
p = 0
x = 0
End If
Next
End If

merci pour votre aide!

Chris