Private
Sub
CommandButton_NutzwertanalyseStart_Click()
Dim
Suchbegriff
As
String
Dim
ZeileTreffer
As
Long
Dim
rngGefunden
As
Range
With
Worksheets(
"Nutzwertanalyse"
)
For
Spalte = 2
To
20
.Activate
Suchbegriff = .Cells(3, Spalte).Value
Set
rngGefunden = Worksheets(
"Materialdatenbank"
).Columns(
"A:A"
).Find(What:=Suchbegriff, _
After:=ActiveCell, LookIn:=xlWhole, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=
False
, SearchFormat:=
False
)
ZeileTreffer = rngGefunden.Row
If
Worksheets(
"Materialdatenbank"
).Cells(ZeileTreffer, 3).Value < Prozesstemp
Then
.Cells(4, Spalte).Value = 0
ElseIf
Worksheets(
"Materialdatenbank"
).Cells(ZeileTreffer, 3).Value > Prozesstemp
And
_
Worksheets(
"Materialdatenbank"
).Cells(ZeileTreffer, 3).Value < Prozesstemp + 10
Then
.Cells(4, Spalte).Value = 1
ElseIf
Worksheets(
"Materialdatenbank"
).Cells(ZeileTreffer, 3).Value > Prozesstemp + 10
Then
.Cells(4, Spalte).Value = 3
End
If
Next
End
With
End
Sub