Makro anpassen
14.12.2014 10:39:47
RolfK.
Hallo
Dieses Makro möchte ich anpassen. Bei der Sicherheitsabfrage MsgBox "Eintrag Kanalschein bestellt schon vorhanden!" möchte ich eine Zusatzfrage, ob der Eintrag trotzdem erfolgen soll.
Gruss RolfK.
Sub Stammdaten_nach_Kanalscheine_neu_kopieren()
Dim Loletzte As Long
Dim rng As Range
With Sheets("Kanalscheine bestellt")
Set rng = .Range("h2:h130").Find(What:=Selection, _
LookIn:=xlValues, LookAt:=xlWhole)
If Not rng Is Nothing Then
MsgBox "Eintrag Kanalschein bestellt schon vorhanden!", vbExclamation
Exit Sub
End If
End With
With Sheets("Kanalscheine neu")
Sheets("Kanalscheine neu").Unprotect
Set rng = .Range("h4:h50").Find(What:=Selection, _
LookIn:=xlValues, LookAt:=xlWhole)
If Not rng Is Nothing Then
MsgBox "Eintrag Kanalscheine neu schon vorhanden!", vbExclamation
Exit Sub
End If
End With
With Sheets("Kanalscheine neu")
If Range("B145") = "" Then
'Alt:
'Loletzte = .Range("b40").End(xlUp).Row
'Range(Cells(ActiveCell.Row, 2), Cells(ActiveCell.Row, 8)).Copy Destination:=.Cells( _
Loletzte + 1, 2)
Loletzte = .Range("b40").End(xlUp).Row
.Cells(Loletzte + 1, 3).Value = Cells(ActiveCell.Row, 2).Value
.Cells(Loletzte + 1, 2).Value = Cells(ActiveCell.Row, 3).Value
.Cells(Loletzte + 1, 4).Value = Cells(ActiveCell.Row, 14).Value
.Cells(Loletzte + 1, 7).Value = Cells(ActiveCell.Row, 7).Value
.Cells(Loletzte + 1, 8).Value = Cells(ActiveCell.Row, 8).Value
Else
MsgBox "keine Zelle mehr frei"
End If
End With
Sheets("Mitglieder bezahlt").Select
Call Ausdruck_bezahlt
Sheets("Kanalscheine neu").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, _
Scenarios:=True
End Sub