Sub
TestMakro5()
Dim
Zelle
As
Range, Wsh
As
Excel.Worksheet, flag
As
Boolean
On
Error
GoTo
errh
Sheets(
"Abdeckung"
).
Select
Set
Zelle = ActiveCell
For
Each
Wsh
In
ThisWorkbook.Sheets
If
Wsh.Name =
"Test ID"
& Zelle.Formula
Then
flag =
True
Exit
For
End
If
Next
Wsh
Application.ScreenUpdating =
False
If
Not
flag =
True
Then
Sheets(
"Muster"
).Copy After:=Sheets(Sheets.Count)
Set
Wsh = ThisWorkbook.Sheets(Sheets.Count)
With
Wsh
.Name =
"Test ID"
& Zelle.Formula
.Visible = xlSheetVisible
.Range(
"B2"
).Font.Bold =
True
End
With
Zelle.Copy
Wsh.Range(
"B2"
).PasteSpecial xlPasteValues
Application.CutCopyMode =
False
End
If
Wsh.Activate
errh:
Application.ScreenUpdating =
True
End
Sub