Viele Dank :-)
31.08.2007 11:20:00
Rainer
Es geht ja wieder mal richtig ab hier!
Supervielen Dank für die Überflutung von Antworten.
ich habe zuerst ULF's version versucht (für mich am Einfachsten zu verstehen)
das hat aber nicht geklappt:
Sub SalesTeamFieldSalesLagerFix_V2()
Dim iRowL As Integer, iRow As Integer
Dim SpalteEins As Integer
Dim SpalteZwei As Integer
Dim SpalteDrei As Integer
Dim Faktor As Single
SpalteEins = 53 ' Faktor 1
SpalteZwei = 54 ' Spalte Produkt
SpalteDrei = 5 ' Spalte für Bereichsüberprüfung
Faktor = Worksheets("int Leistungsverrechnung").Range("B93")
iRowL = Cells(Rows.Count, 1).End(xlUp).Row
For iRow = 1 To iRowL
If Cells(iRow, SpalteEins).Value > 0 And Cells(iRow, SpalteDrei).Value = "Print" Then
Cells(iRow, SpalteZwei) = Cells(iRow, 1) * Faktor
End If
Next iRow
End Sub
Dann habe ich Chaos's Version genommen und die geht jetzt.
Sub SalesTeamFieldSalesLagerFix_V3()
Dim iRowL As Integer, iRow As Integer
Dim SpalteEins As Integer
Dim SpalteZwei As Integer
Dim SpalteDrei As Integer
Dim Faktor As Single
Dim s As String
SpalteEins = 53 ' Faktor 1
SpalteZwei = 54 ' Spalte Produkt
SpalteDrei = 5 ' Spalte für Bereichsüberprüfung
Faktor = Worksheets("int Leistungsverrechnung").Range("B93")
iRowL = Cells(Rows.Count, 1).End(xlUp).Row
For iRow = 1 To iRowL
s = Cells(iRow, SpalteEins).Value
If IsNumeric(s) Then ' Abfrage, ob Zahl
If Cells(iRow, SpalteEins).Value > 0 And Cells(iRow, SpalteDrei).Value = "Print" Then
Cells(iRow, SpalteZwei) = Cells(iRow, SpalteEins) * Faktor
End If
End If
Next iRow
End Sub
Deine Version Renee ist wohl die eleganteste, aber für mich auch die schwierigste zum verstehen, da ich noch nicht so das gross Know how habe.
Danke nochmals an alle! :-)