Option Explicit
Public PrevSh As Worksheet
Public ThisSh As Worksheet
Public ThisShN As String
Public CopySh As Worksheet
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
'Erik Van Geit
'050812 1802
With Application
.ScreenUpdating = False
.EnableEvents = False
.DisplayAlerts = False
End With
Set ThisSh = ActiveSheet
On Error Resume Next
PrevSh.Delete
With CopySh
.Name = ThisShN
.Visible = xlSheetVisible
End With
On Error GoTo 0
With ThisSh
ThisShN = .Name
.Copy before:=Sheets(.Index)
Set CopySh = ActiveSheet
End With
With CopySh
.Visible = xlSheetVeryHidden
End With
With Application
.ScreenUpdating = True
.EnableEvents = True
.DisplayAlerts = True
End With
Set PrevSh = ThisSh
End Sub