Private
Sub
Artikel_Click()
On
Error
Resume
Next
Verbrauchsübersicht.Image1.Picture = LoadPicture(...)
Dim
Scanartikel
Set
Scanartikel = Sheets(
"Warenbewegung"
).Columns(1).Find(what:=Right(Artikel, 4))
Dim
rng3
As
Range
Set
rng3 = Sheets(
"Warenbewegung"
).Columns(5)
Dim
rng
As
Range
Set
rng = Sheets(
"Warenbewegung"
).Columns(1)
If
Not
Scanartikel
Is
Nothing
Then
Dim
Ergebnis
As
Long
Ergebnis = Application.WorksheetFunction.SumIfs(rng3, rng, Scanartikel, rng3,
"<1"
)
Paletten.Value = Ergebnis / -1
Else
MsgBox
"Artikel wurde noch nicht verbraucht!"
End
If
Dim
Bestandsartikel
Set
Bestandsartikel = Sheets(
"Bestandsübersicht"
).Columns(1).Find(what:=Right(Artikel, 4))
TextBox3.text = Bestandsartikel.text
TextBox4.text = Bestandsartikel.offset(0, 2).text
TextBox6.text = Bestandsartikel.offset(0, 4).text
TextBox7.text = Bestandsartikel.offset(0, 1).text
BIST.text = Bestandsartikel.offset(0, 6).text
BSOLL.text = Bestandsartikel.offset(0, 9).text
End
Sub