AW: Application.ScreenUpdating
21.01.2020 17:41:50
Andreas
Ja glaube schon das da ein select vorkommt...
Sub Kopie()
Application.ScreenUpdating = True 'Schaltet den Bildschirm wieder aus
Dim wsh As Worksheet
For Each wsh In ActiveWorkbook.Worksheets
If wsh.Name = "Tabelle1" Then Exit For
Next
If wsh Is Nothing Then
''hier der Code, wenn das gesuchte Blatt nicht vorhanden ist
' Löschen "Tabelle1"
Call Copy_Umbennen
Else
''hier der Code wenn das Blatt vorhanden ist. Du kannst
''jetzt die Variable wsh verwenden, um dieses Blatt anzusprechen.
' Löschen "Tabelle1"
Sheets("Tabelle1").Select
ActiveWindow.SelectedSheets.Delete
Call Copy_Umbennen
End If
Application.ScreenUpdating = False 'Schaltet den Bildschirm an
End Sub
Sub Copy_Umbennen()
'#### Schritt1
' Bestand in Tabelle1 Copy und Umbennen
' und Anordnung der Fenster
ActiveWindow.Zoom = 50
Sheets("Bestand").Select
Sheets("Bestand").Copy Before:=Sheets(2)
Sheets("Bestand (2)").Select
Sheets("Bestand (2)").Name = "Tabelle1"
Range("U32").Select
Sheets("Bestand").Select
ActiveWindow.NewWindow
ActiveWorkbook.Windows.Arrange ArrangeStyle:=xlVertical
Sheets("Bestand").Select
ActiveWindow.Zoom = 50
Application.Left = 463
Application.Top = 1
Application.Width = 978.75
Application.Height = 781.5
Windows("Vorlage Normal-Bearbeitung.xlsm:1").Activate
Sheets("Tabelle1").Select
Application.Left = 739.75
Application.Top = 1
Application.Width = 702
Application.Height = 781.5
Application.Left = 0.25
Application.Top = 1
Application.Width = 484.5
Application.Height = 781.5
Windows("Vorlage Normal-Bearbeitung.xlsm:2").Activate
Application.Left = 484
Application.Top = 1
Application.Width = 957.75
Application.Height = 781.5
Windows("Vorlage Normal-Bearbeitung.xlsm:1").Activate
ActiveWindow.Zoom = 90
ActiveWindow.ScrollColumn = 1
ActiveWindow.SmallScroll Down:=-3
Range("B10").Select
Windows("Vorlage Normal-Bearbeitung.xlsm:1").Activate
ActiveWindow.Zoom = 50
Windows("Vorlage Normal-Bearbeitung.xlsm:2").Activate
Sheets("Tabelle1").Select
Application.Left = 499.75
Application.Top = 1
Application.Width = 498
Application.Height = 781.5
Windows("Vorlage Normal-Bearbeitung.xlsm:1").Activate
Sheets("Bestand").Select
Windows("Vorlage Normal-Bearbeitung.xlsm:2").Activate
ActiveWindow.SmallScroll Down:=12
Application.Left = 486.25
Application.Top = 1
Application.Width = 955.5
Application.Height = 781.5
Workbooks.Open Filename:="D:\Elektro Arbeit\ProtokollnR1.xlsm"
Application.Left = 739.75
Application.Top = 1
Application.Width = 702
Application.Height = 781.5
Application.Left = 0.25
Application.Top = 1
Application.Width = 484.5
Application.Height = 781.5
End Sub
Grüße Andreas