AW: Leider ein kleines problem
23.05.2008 14:03:00
Ernst
Hallo Hajo !
Danke für die Lösung ,bringt mir jedoch einen Fehler da ich in meinem Arbeitsblatt noch andere Makro vorhanden sind..
Anbei alle Makro die in dem Arbeitsblatt vorhanden sind inklusive deinem.....
Konkreter Fehler: Mehrdeutiger Name Workbook before close..
Vieleicht gibts hierzu auch ne Lösung ?
Lg.Ernst
Option Explicit
' ENTF-Taste wieder zurücksetzen
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If ActiveSheet.Name = "Zawadil+Entwerter" Or ActiveSheet.Name = "Reserve+Rep." Then
Application.OnKey "{DELETE}"
End If
End Sub
' ENTF-Taste neu belegen
Private Sub Workbook_Open()
If ActiveSheet.Name = "Zawadil+Entwerter" Then
Application.OnKey "{DELETE}", "Loeschen"
ElseIf ActiveSheet.Name = "Reserve+Rep." Then
Application.OnKey "{DELETE}", "Loeschen2"
End If
End Sub
Option Explicit
Public OldIndex As Integer
Public OldCell As Range
Private Sub Workbook_Activate()
On Error Resume Next
OldCell.Interior.ColorIndex = OldIndex
If Selection.Count = 1 Then
If Not OldCell Is Nothing Then
OldIndex = ActiveCell.Interior.ColorIndex
End If
ActiveCell.Interior.ColorIndex = 4 'gelb
Set OldCell = ActiveCell
End If
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Not OldCell Is Nothing Then
OldCell.Interior.ColorIndex = OldIndex
Set OldCell = Nothing
End If
End Sub
Private Sub Workbook_Deactivate()
If Not OldCell Is Nothing Then
OldCell.Interior.ColorIndex = OldIndex
Set OldCell = Nothing
End If
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
On Error Resume Next
OldCell.Interior.ColorIndex = OldIndex
If Target.Count = 1 Then
If Not OldCell Is Nothing Then
OldIndex = Target.Interior.ColorIndex
End If
Target.Interior.ColorIndex = 4 'gelb
Set OldCell = Target
End If
End Sub