Supportnet / Forum / Tabellenkalkulation
Makros für ein bestimmtes Tabellenblatt
Frage
Hi Excelspezialisten,
ist möglich, das Makros nur in einem bestimmten Tabellenblatt ausgeführt werden?
Vielen Dank im Vorraus.
Gruß
fedjo
z.B. Arbeitsmappe:
Private Sub Workbook_Deactivate()
Application.OnKey "{Return}"
Application.OnKey "{Enter}"
End Sub
Private Sub Workbook_Activate()
Application.OnKey "{Return}", "Schaller"
Application.OnKey "{Enter}", "Leerzelle_Speichern"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnKey "{Return}"
Application.OnKey "{Enter}"
End Sub
Private Sub Workbooi_Open()
Application.OnKey "{Return}", "Schaller"
Application.OnKey "{Enter}", "Leerzelle_Speichern"
End Sub
Antwort 1 von gesemmelt
Hallo fedjo,
Wenn Du das über die Worksheet-Ereignisse des bestimmten Tabellenblattes steuerst, dann ja.
Private Sub Worksheet_Activate()
Application.OnKey "{Return}", "Schaller"
Application.OnKey "{Enter}", "Leerzelle_Speichern"
End Sub
Gruß gesemmelt
Wenn Du das über die Worksheet-Ereignisse des bestimmten Tabellenblattes steuerst, dann ja.
Private Sub Worksheet_Activate()
Application.OnKey "{Return}", "Schaller"
Application.OnKey "{Enter}", "Leerzelle_Speichern"
End Sub
Gruß gesemmelt
Antwort 2 von fedjo
Hallo gesemmelt,
Danke für Deine Antwort!
Ich muß aber dann immer das Tabellenblatt nach dem öffnen der Arbeitsmappe aktivieren.
Kann man das Tabellenblatt nicht vielleicht auch automatisch aktivieren?
Gruß
fedjo
Danke für Deine Antwort!
Ich muß aber dann immer das Tabellenblatt nach dem öffnen der Arbeitsmappe aktivieren.
Kann man das Tabellenblatt nicht vielleicht auch automatisch aktivieren?
Gruß
fedjo
Antwort 3 von rexi
Das sollte eigentlich mit dem Workbook_open Event gehen:
- Private Sub Workbook_Open()
sheets("bestimmtes Tabellenblatt").activate
End Sub
Antwort 4 von fedjo
Hi rexi,
Danke für die Antwort!
Dein Cote brachte leider nicht den gwünschten Erfolg.
Ich habe das Problem jetzt so gelöst.
Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnKey "{Return}"
Application.OnKey "{Enter}"
End Sub
Private Sub Workbook_Open()
Application.OnKey "{Return}", "Schaller"
Application.OnKey "{Enter}", "Leerzelle_Speichern"
End Sub
Worksheet:
Private Sub Worksheet_Deactivate()
Application.OnKey "{Return}"
Application.OnKey "{Enter}"
End Sub
Private Sub Worksheet_Activate()
Application.OnKey "{Return}", "Schaller"
Application.OnKey "{Enter}", "Leerzelle_Speichern"
End Sub
Gruß
fedjo
Danke für die Antwort!
Dein Cote brachte leider nicht den gwünschten Erfolg.
Ich habe das Problem jetzt so gelöst.
Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnKey "{Return}"
Application.OnKey "{Enter}"
End Sub
Private Sub Workbook_Open()
Application.OnKey "{Return}", "Schaller"
Application.OnKey "{Enter}", "Leerzelle_Speichern"
End Sub
Worksheet:
Private Sub Worksheet_Deactivate()
Application.OnKey "{Return}"
Application.OnKey "{Enter}"
End Sub
Private Sub Worksheet_Activate()
Application.OnKey "{Return}", "Schaller"
Application.OnKey "{Enter}", "Leerzelle_Speichern"
End Sub
Gruß
fedjo

