AW: Userform Bestellliste
16.05.2013 11:06:55
Rudi
Hallo,
Private Sub CommandButton3_Click()
Dim r As Integer, i As Integer, n As Integer
With ListBox1
For i = 0 To .ListCount - 1
n = n - .Selected(i)
Next
If .ListCount = 0 Or n = 0 Then
MsgBox "Es sind keine Artikel markiert oder vorhanden!", vbInformation, "Information"
Exit Sub
End If
End With
If MsgBox("Haben Sie diese(n) Artikel auch wirklich bestellt?", vbQuestion + vbYesNo) = _
vbYes Then
i = 0
With ListBox1
Do
If .Selected(i) Then
Sheets("Buchung").Cells(.List(i, 4), 4) = "Ja"
.RemoveItem (i)
Else
i = i + 1
End If
Loop Until i = .ListCount
End With
End If
Sheets("Buchung").EnableAutoFilter = True
End Sub
Private Sub UserForm_Initialize()
Dim r As Integer
Dim x As Integer
' Bestellliste.Caption = "Bestellliste - Lagerbuchhaltung " & Date & " " & Format(Time, _
"hh:mm") & " h"
Application.ScreenUpdating = False
Sheets("Buchung").Select
With Bestellliste
.ListBox1.ColumnCount = 4
.ListBox1.ColumnWidths = "32;80;96;90;40"
.ListBox1.Clear
x = 0
For r = 2 To 10000
If Cells(r, 1).Value = "" Then Exit For
If Cells(r, 7).Value
Gruß
Rudi