ChristianDK
Programmer
Thanks to the help on this forum i have made the following:
Sub KlarTilUdskriftAlt()
Sheets("Nøgl").Visible = False
For i = 2 To ActiveWorkbook.Sheets.Count - 5
Set SheetMark = ActiveWorkbook.Sheets(i)
If SheetMark.Visible Then
SheetMark.Range("A1").AutoFilter Field:=1, Criteria1:="="
SheetMark.PageSetup.LeftFooter = "&""Times New Roman,Normal""&9 " & Range("inddata!b3")
ActiveWindow.View = xlPageBreakPreview
Else
End If
Next
Sheets("ForR").PageSetup.LeftFooter = ""
Sheets("Reer").PageSetup.LeftFooter = ""
Sheets("ForS").PageSetup.LeftFooter = ""
End Sub
On the computer I am working on it takes about 3 sec to run it, but on the laptops it takes around 16 sec. Any way to make it go faster? other then buy new laptops![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Also the "ActiveWindow.View = xlPageBreakPreview" i cant seem to make it work on sheets, ActiveWindow? any way to make it work on at none selected sheet?
i like to use it with my "SheetMark" so all the sheets are effected by the autofilter and shows the pagebreak view(not hidden sheets)
Hope any of you got any good ideér's![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Sub KlarTilUdskriftAlt()
Sheets("Nøgl").Visible = False
For i = 2 To ActiveWorkbook.Sheets.Count - 5
Set SheetMark = ActiveWorkbook.Sheets(i)
If SheetMark.Visible Then
SheetMark.Range("A1").AutoFilter Field:=1, Criteria1:="="
SheetMark.PageSetup.LeftFooter = "&""Times New Roman,Normal""&9 " & Range("inddata!b3")
ActiveWindow.View = xlPageBreakPreview
Else
End If
Next
Sheets("ForR").PageSetup.LeftFooter = ""
Sheets("Reer").PageSetup.LeftFooter = ""
Sheets("ForS").PageSetup.LeftFooter = ""
End Sub
On the computer I am working on it takes about 3 sec to run it, but on the laptops it takes around 16 sec. Any way to make it go faster? other then buy new laptops
Also the "ActiveWindow.View = xlPageBreakPreview" i cant seem to make it work on sheets, ActiveWindow? any way to make it work on at none selected sheet?
i like to use it with my "SheetMark" so all the sheets are effected by the autofilter and shows the pagebreak view(not hidden sheets)
Hope any of you got any good ideér's