Gruppe
Ereignis
Problem
Wie kann ich bei Doppelklick und/oder Schaltflächendruck die aktive Zeile in ein anderes Tabellenblatt kopieren?
StandardModule: basMain
Sub CopyRow()
Call CopyNow(ActiveCell.Row)
End Sub
Sub CopyNow(iRow As Integer)
Dim wks As Worksheet
Dim iRowL As Integer
Application.ScreenUpdating = False
Set wks = Worksheets("Tabelle2")
iRowL = wks.Cells(Rows.Count, 1).End(xlUp).Row + 1
Rows(iRow).Copy wks.Rows(iRowL)
Application.CutCopyMode = False
wks.Columns.AutoFit
Application.ScreenUpdating = True
End Sub
ClassModule: Tabelle1
Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
Cancel = True
Call CopyNow(Target.Row)
End Sub