Like the title says. i written a code which lets me add sheets and rename them accordingly. But since i changed something yesterday (i dont know what exactly) it just doesnt run properly anymore.
that is the code:
in the code are many things commented out, to try new things but it didnt really work. does anyone have any idea?
that is the code:
VBA Code:
Sub DeleteSheetsBetweenFirstAndLastMarkerSheets()
'Updateby Extendoffice
On Error GoTo Errorhandler
Dim ws As Worksheet
Set wh = Worksheets(ActiveSheet.Name)
With Worksheets("Vorlage").Range("AnzahlTage")
.Value = .Value + 1
Sheets("Vorlage").Copy before:=Worksheets("YARA")
If IsNumeric(.Value) Then
'ActiveSheet.Name = "Tag " & .Value
ActiveSheet.Name = "t" & .Value
'Sheets("Tag " & .Value).Tab.ColorIndex = 10
'Sheets(.Value).Tab.ColorIndex = 10
.Value = .Value + 1
End If
GoTo ciao
Errorhandler:
MsgBox "Befehl konnte nicht ausgeführt werden, da es die tabelle mit dem namen """ & .Value & """ schon exisitiert"
'MsgBox "Befehl konnte nicht ausgeführt werden, da es die tabelle mit dem namen ""Tag " & .Value & """schon exisitiert"
End With
ciao:
End Sub
in the code are many things commented out, to try new things but it didnt really work. does anyone have any idea?