Bonsoir le forum
J'utilise le code ci-dessous pour afficher ou masquer une forme selon la valeur de la cellule correspondante (Les cellules sont dans la même colonne mais pas contiguës). Le code fonctionne bien seulement je souhaite éviter ce code répétitif et faire une boucle. Est ce possible?
Merci d'avance pour votre aides
Cordialement
J'utilise le code ci-dessous pour afficher ou masquer une forme selon la valeur de la cellule correspondante (Les cellules sont dans la même colonne mais pas contiguës). Le code fonctionne bien seulement je souhaite éviter ce code répétitif et faire une boucle. Est ce possible?
Merci d'avance pour votre aides
Cordialement
VB:
If UCase(Range("M10").Value) = "" Then
Shapes.Range(Array("__4")).Visible = msoFalse
Else
Shapes.Range(Array("__4")).Visible = msoTrue
End If
If UCase(Range("M12").Value) = "" Then
Shapes.Range(Array("__5")).Visible = msoFalse
Else
Shapes.Range(Array("__5")).Visible = msoTrue
End If
If UCase(Range("M14").Value) = "" Then
Shapes.Range(Array("__6")).Visible = msoFalse
Else
Shapes.Range(Array("__6")).Visible = msoTrue
End If
If UCase(Range("M16").Value) = "" Then
Shapes.Range(Array("__7")).Visible = msoFalse
Else
Shapes.Range(Array("__7")).Visible = msoTrue
End If
If UCase(Range("M18").Value) = "" Then
Shapes.Range(Array("__8")).Visible = msoFalse
Else
Shapes.Range(Array("__8")).Visible = msoTrue
End If
If UCase(Range("M20").Value) = "" Then
Shapes.Range(Array("__9")).Visible = msoFalse
Else
Shapes.Range(Array("__9")).Visible = msoTrue
End If