AW: Immer Zielformat beim Einfügen
22.04.2014 23:14:46
Tino
Hallo,
kannst mal so versuchen.
Tabelle im Code überall anpassen, im Beispiel ist die Tabelle1 eingebaut.
kommt als Code in DieseArbeitsmappe
Option Explicit
Private Sub Workbook_Activate()
If ActiveSheet.CodeName = "Tabelle1" Then 'Tabelle anpassen (Codename)
Application.OnKey "^v", "InhaltEinfuegen"
End If
End Sub
Private Sub Workbook_Deactivate()
Application.OnKey "^v"
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.CodeName = "Tabelle1" Then 'Tabelle anpassen (Codename)
Application.OnKey "^v", "InhaltEinfuegen"
End If
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
If Sh.CodeName = "Tabelle1" Then 'Tabelle anpassen (Codename)
Application.OnKey "^v"
End If
End Sub
kommt als Code in Tabelle1
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If InStr(LCase(Application.CommandBars("Edit").Controls(1).Caption), "einfügen") > 0 Then
Call InhaltEinfuegen
End If
End Sub
kommt als Code in Modul1
Option Explicit
Sub InhaltEinfuegen()
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub
Gruß Tino