Re: ALLES VERSTECKEN
14.12.2002 00:42:17
Sven
Hallo Sascha,ich gehe mal davon aus das Du nicht im Archiv gesucht hast.
https://www.herber.de/forum/archiv/search/searchlist.htm
hilft bei den meisten kleineren Sachen schon weiter.
Hier trotzdem ein bisschen MakroCode für Dich
' -- workbook_open() bei oeffnen der Datei ausfuehren
Private Sub workbook_open()
Application.DisplayStatusBar = False
Application.DisplayFormulaBar = False
ActiveWindow.WindowState = xlMaximized
Application.AskToUpdateLinks = True
Dim wbk As String
wbk = ActiveWorkbook.Name
Application.CommandBars(1).Enabled = False
Dim cb As CommandBar
For Each cb In Application.CommandBars
cb.Enabled = False
Next cb
' alle Spalten- und Zeilenköpfe ausblenden
Dim I As Integer
Application.ScreenUpdating = False
For I = 1 To ActiveWorkbook.Worksheets.Count
Worksheets(I).Activate
ActiveWindow.DisplayHeadings = False
Worksheets(I).ScrollArea = "A1:K200"
Next I
Application.ScreenUpdating = True
DateimitOrt = Application.ThisWorkbook.Path & "\Datenbank.xls"
Workbooks.Open Filename:=DateimitOrt
Application.AskToUpdateLinks = False
Workbooks(wbk).Activate '-- zu Muster Arbeitsmappe wechseln
Worksheets("Einstellungen").Select '-- Sheet: Einstellungen
End Sub
' -- Workbook_BeforeClose() bei schliessen der Datei ausfuehren
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True '-- gaukelt Excel vor das bereits gespeichetr wurde (=schliessen ohne speichern)
Application.DisplayAlerts = False
Application.CommandBars(1).Enabled = True
Dim cb As CommandBar
For Each cb In Application.CommandBars
cb.Enabled = True
Next cb
' -- Wenn Datenbanx.xls noch offen -> schlissen
For Each x In Workbooks
If x.Name = "Datenbank.xls" Then
Workbooks("Datenbank.xls").Close
End If
Next
' alle Spalten- und Zeilenköpfe ausblenden
Dim I As Integer
Application.ScreenUpdating = False
For I = 1 To ActiveWorkbook.Worksheets.Count
Worksheets(I).Activate
ActiveWindow.DisplayHeadings = True
Next I
Application.ScreenUpdating = True
Application.DisplayFormulaBar = True
Application.AskToUpdateLinks = False
Application.DisplayStatusBar = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Grüße
Sven