22. marts 2007 - 08:51Der er
5 kommentarer og 1 løsning
automatisk sideskift
Jeg har fået hjælp til nedenstående kode på et tidspunkt. Koden laver et automatisk / tvunget sideskift på de rigtige steder på mit ark......men...... Koden laver fejl hvis der kun er EN side, så der IKKE skal laves sideskift.
For Each pb In Worksheets("noter").HPageBreaks J = pb.Location.Row If Rows(J).PageBreak = xlPageBreakAutomatic Then If Cells(J, "A") = "" Then A = Cells(J, "A").End(xlUp).Row Rows(A).PageBreak = xlPageBreakManual End If End If Next pb
With Worksheets("noter").HPageBreaks J = .Item(.Count).Location.Row If Rows(J).PageBreak = xlPageBreakAutomatic Then If Cells(J, "A") = "" Then A = Cells(J, "A").End(xlUp).Row Rows(A).PageBreak = xlPageBreakManual End If End If End With 'Application.ScreenUpdating = True Range("A1").Select
Cells.PageBreak = xlPageBreakNone If Worksheets("noter").HPageBreaks.Count > 0 Then ' NY Range(Range("C65536").End(xlUp).Address).Select
Application.ScreenUpdating = False
For Each pb In Worksheets("noter").HPageBreaks J = pb.Location.Row If Rows(J).PageBreak = xlPageBreakAutomatic Then If Cells(J, "A") = "" Then A = Cells(J, "A").End(xlUp).Row Rows(A).PageBreak = xlPageBreakManual End If End If Next pb
With Worksheets("noter").HPageBreaks J = .Item(.Count).Location.Row If Rows(J).PageBreak = xlPageBreakAutomatic Then If Cells(J, "A") = "" Then A = Cells(J, "A").End(xlUp).Row Rows(A).PageBreak = xlPageBreakManual End If End If End With 'Application.ScreenUpdating = True Range("A1").Select
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.