Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

auf mehreren Blättern gleichztg d. Schutz aufheben

Forumthread: auf mehreren Blättern gleichztg d. Schutz aufheben

auf mehreren Blättern gleichztg d. Schutz aufheben
20.09.2003 15:55:42
Elmar Steigenberger
Hallo,

kann man in VB auf mehreren Blättern gleichzeitig den Schutz aufheben ohne dass eine For Next-Schleife mit den Blattnamen laufen muß?

Dieser Befehl geht voraus:

Sheets(Array("Üb", "ÜbSpz", "Za-Eg", "Za-Üb", "Di", "Miza", "Nkza", "Gaza", "Gaza2", "Arf", "Nk-Abr", "Sv", "VaS", "KaWa")).Select

Blätter sind nicht Passwortgeschützt!

liebe e-Grüße
Elmar

====================================
Die erstaunliche und absolut schreckliche Wahrheit über den 11.09.01
www.elfterseptember.info
Anzeige

5
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
nicht möglich oT
20.09.2003 16:08:07
Jochen
oT
probiersmal damit ...
20.09.2003 19:06:50
udo
Hi Elmar vielleicht so , ...


Sub Blattschutz()
' füge dieses Makro in ein Modul, und weise es einem Button zu, müsste
' dann eigentlich wenn du diesen Button in jedem Blatt hast , dann auch
' aus jeder Tab. zu starten sein.
' und in A1 also Cells (1, 1) sollte nichts stehn, so müsstest du halt eine andere
' Zelle angeben...
Application.ScreenUpdating = False
If Cells(1, 1) = "ein" Then
Sheets("Üb").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("ÜbSpz").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("Za-Üb").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("Di").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("Miza").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("Nkza").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("Gaza").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("Arf").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("Nk-Abr").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("Sv").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("VaS").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Sheets("KaWa").Select
ActiveSheet.Unprotect
Cells(1, 1) = "aus"
Else
Sheets("Üb").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("ÜbSpz").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Za-Üb").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Di").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Miza").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Nkza").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Gaza").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Arf").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Nk-Abr").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Sv").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("VaS").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("KaWa").Select
Cells(1, 1) = "ein"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
Application.ScreenUpdating = True
End Sub



Gruß udo
Anzeige
AW: auf mehreren Blättern gleichztg d. Schutz aufheben
20.09.2003 22:36:05
Josef Ehrensberger
Hallo Elmar,

Füge auf deinem ersten Tabellenblatt einen Button
aus der Formular-Toolbox ein.
Benenne ihn mit "btn1" und weise ihm folgendes
Makro zu.

-------Standard Modul--------
Option Explicit
Public myState As Boolean


Sub AnAus()
Dim wsht As Worksheet
On Error Resume Next
Application.ScreenUpdating = False
For Each wsht In ThisWorkbook.Worksheets
If myState = False Or myState = Empty Then
wsht.Activate
wsht.Shapes("btn1").Select
Selection.Characters.Text = "Schutz Aus"
wsht.Protect
myState = True
[A1].Select
Else
wsht.Activate
wsht.Unprotect
wsht.Shapes("btn1").Select
Selection.Characters.Text = "Schutz An"
myState = False
[A1].Select
End If
Next
Application.ScreenUpdating = True
End Sub


-----------------------------------

Kopiere den Button in alle Tabellenblätter.

Gruß Sepp
Anzeige
AW: Schutz aufheben ohne Select
20.09.2003 22:39:09
Beni
Hallo Elmar,
es geht auch ohne Select.
Gruss Beni

Sheets("Üb").Unprotect
Sheets("ÜbSpz.Unprotect
Sheets("Za-Üb").Unprotect
Sheets("Di").Unprotect
Sheets("Miza").Unprotect
Sheets("Nkza").Unprotect
Sheets("Gaza").Unprotect
Sheets("Arf").Unprotect
Sheets("Nk-Abr").Unprotect
Sheets("Sv").Unprotect
Sheets("VaS").Unprotect
Sheets("KaWa").Unprotect
Anzeige
AW: Schutz aufheben ohne Select
20.09.2003 22:39:19
Beni
Hallo Elmar,
es geht auch ohne Select.
Gruss Beni

Sheets("Üb").Unprotect
Sheets("ÜbSpz.Unprotect
Sheets("Za-Üb").Unprotect
Sheets("Di").Unprotect
Sheets("Miza").Unprotect
Sheets("Nkza").Unprotect
Sheets("Gaza").Unprotect
Sheets("Arf").Unprotect
Sheets("Nk-Abr").Unprotect
Sheets("Sv").Unprotect
Sheets("VaS").Unprotect
Sheets("KaWa").Unprotect
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige