Voyez le fichier joint et cette macro dans le code de la feuille :
VB:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim plage As Range, h As HPageBreak
Set plage = [46:55]
For Each h In HPageBreaks
If Not Intersect(h.Location, plage) Is Nothing Then Set h.Location = plage(1)
Next
End Sub
Le saut de page est déplacé en haut de la plage fusionnée.
Voyez le fichier joint et cette macro dans le code de la feuille :
VB:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim plage As Range, h As HPageBreak
Set plage = [46:55]
For Each h In HPageBreaks
If Not Intersect(h.Location, plage) Is Nothing Then Set h.Location = plage(1)
Next
End Sub
Le saut de page est déplacé en haut de la plage fusionnée.
Hello,
Ta solution fonstionne parfaitement, je l'ai mis en place depuis longtemps.
J'aimerai aller plus loin.
Pour que la mise en page se fasse aujourd'hui je suis obligé d'activer la page pour que la fonction se mette en place.
Y a t'il une solution pour éviter cette manipulation ? Aujourd'hui je fais la mise en page de mes feuilles sur une feuille de contrôle en utilisant "Application.ScreenUpdating = False" , ce qui me permet d'avoir des macros rapides.
Autre piste mettre cette fonction dans une macro que je pourrais appeler à souhait.
Merci de ton aide
Voici mon code
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim plage As Range, h As HPageBreak
Set plage = [54:55]
For Each h In HPageBreaks
If Not Intersect(h.Location, plage) Is Nothing Then Set h.Location = plage(1)
Next
Dim plage2 As Range, H2 As HPageBreak
Set plage2 = [74:76]
For Each H2 In HPageBreaks
If Not Intersect(H2.Location, plage2) Is Nothing Then Set H2.Location = plage2(1)
Next
Dim plage3 As Range, h3 As HPageBreak
Set plage3 = [181:195]
For Each h3 In HPageBreaks
If Not Intersect(h3.Location, plage3) Is Nothing Then Set h3.Location = plage3(1)
Next
Dim plage4 As Range, h4 As HPageBreak
Set plage4 = [197:200]
For Each h4 In HPageBreaks
If Not Intersect(h4.Location, plage4) Is Nothing Then Set h4.Location = plage4(1)
Next
Dim plage5 As Range, h5 As HPageBreak
Set plage5 = [201:202]
For Each h5 In HPageBreaks
If Not Intersect(h5.Location, plage5) Is Nothing Then Set h5.Location = plage5(1)
Next
Dim plage6 As Range, h6 As HPageBreak
Set plage6 = [203:204]
For Each h6 In HPageBreaks
If Not Intersect(h6.Location, plage6) Is Nothing Then Set h6.Location = plage6(1)
Next
Dim plage7 As Range, h7 As HPageBreak
Set plage7 = [205:206]
For Each h7 In HPageBreaks
If Not Intersect(h7.Location, plage7) Is Nothing Then Set h7.Location = plage7(1)
Next
Dim plage8 As Range, h8 As HPageBreak
Set plage8 = [208:2012]
For Each h8 In HPageBreaks
If Not Intersect(h8.Location, plage8) Is Nothing Then Set h8.Location = plage8(1)
Next
Dim plage9 As Range, H9 As HPageBreak
Set plage9 = [223:225]
For Each H9 In HPageBreaks
If Not Intersect(H9.Location, plage9) Is Nothing Then Set H9.Location = plage9(1)
Next
Dim plage10 As Range, h10 As HPageBreak
Set plage10 = [230:233]
For Each h10 In HPageBreaks
If Not Intersect(h10.Location, plage10) Is Nothing Then Set h10.Location = plage10(1)
Next
Dim plage11 As Range, h11 As HPageBreak
Set plage11 = [236:239]
For Each h11 In HPageBreaks
If Not Intersect(h11.Location, plage11) Is Nothing Then Set h11.Location = plage11(1)
Next
Dim plage12 As Range, h12 As HPageBreak
Set plage12 = [242:259]
For Each h12 In HPageBreaks
If Not Intersect(h12.Location, plage12) Is Nothing Then Set h12.Location = plage12(1)
Next
End Sub
Voyez le fichier joint et cette macro dans le code de la feuille :
VB:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim plage As Range, h As HPageBreak
Set plage = [46:55]
For Each h In HPageBreaks
If Not Intersect(h.Location, plage) Is Nothing Then Set h.Location = plage(1)
Next
End Sub
Le saut de page est déplacé en haut de la plage fusionnée.