Gruppe
Ereignis
Problem
Durch Doppelklick auf eine Preislistenposition soll diese in ein Bestellformular übernommen werden.
StandardModule: basMain
Sub Loeschen()
Worksheets("Bestellung").Range("A11:F" & Rows.Count).ClearContents
End Sub
Sub Kopieren()
Dim objButton As Button
ActiveSheet.Copy
ActiveSheet.Unprotect
ActiveSheet.Buttons.Delete
Range("A9") = "Email: buero-pc-bedarf@t-online.de"
ActiveSheet.Protect
End Sub
ClassModule: Tabelle2
Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Range, Cancel As Boolean)
Dim iRowL As Integer, iRow As Integer, iCounter As Integer
Cancel = True
iRow = Target.Row
If iRow < 8 Then GoTo ErrorHandler
If IsEmpty(Cells(iRow, 1)) Then GoTo ErrorHandler
With Worksheets("Bestellung")
iRowL = .Cells(Rows.Count, 1).End(xlUp).Row + 1
For iCounter = 1 To 4
.Cells(iRowL, iCounter) = Cells(iRow, iCounter)
Next iCounter
.Cells(iRowL, 5).Value = 0
.Cells(iRowL, 6).FormulaR1C1 = "=sum(RC[-2]*RC[-1])"
.Range("B8") = Date
End With
End
ErrorHandler:
MsgBox "Sie müssen einen Artikel doppelklicken"
End Sub