(RESOLU)Simplifier un code (afficher masquer les lignes)

chaelie2015

XLDnaute Accro
BONJOUR FORUM,
Je cherche un code qui soit plus simple a celui-ci
VB:
If Not Intersect(Rows(Target.Row), [M1]) Is Nothing Then
      Application.ScreenUpdating = False
      n = CInt([M1])
      Rows("4:13").Hidden = True
           
      Select Case n
        Case 1
            Rows("4:4").Hidden = False
        Case 2
            Rows("4:5").Hidden = False
        Case 3
            Rows("4:6").Hidden = False
        Case 4
            Rows("4:7").Hidden = False
        Case 5
            Rows("4:8").Hidden = False
        Case 6
            Rows("4:9").Hidden = False
        Case 7
            Rows("4:10").Hidden = False
        Case 8
            Rows("4:11").Hidden = False
        Case 9
            Rows("4:12").Hidden = False
        Case 10
            Rows("4:13").Hidden = False
      End Select
 End If
afficher les lignes de la ligne 4 a la ligne 13 selon le chiffre saisi dans la cellule M1
Salutation
 
Dernière édition:

Ilino

XLDnaute Barbatruc
Re : Simplifier un code (afficher masquer les lignes)

Bonjour Chaelie, si..., bruno,Paf,forum
je te propose
VB:
Rows("16:77").Hidden = 1: Rows("16:" & 16 + Int([V4] + 1)).Hidden = 0 '<===== +1
GRAZIE
 
Dernière édition:

Discussions similaires

Statistiques des forums

Discussions
311 721
Messages
2 081 928
Membres
101 842
dernier inscrit
seb0390