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

Le
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
Vidéos High-Tech et Jeu Vidéo
Téléchargements
Vos réponses
Gagnez chaque mois un abonnement Premium avec GNT : Inscrivez-vous !
Trier par : date / pertinence
isabelle
Le #4464751
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


Chrisdolby
Le #4464741
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





Publicité
Poster une réponse
Anonyme