WENN-DANN-SONST per VBA
14.07.2003 12:44:46
Dannerle
mit folgendem Code möchte ich per VBA eine Wenn-Dann-Sonst-Formel in W einfügen.Leider funzts nicht.
Vielen Dank für jeden Tipp.
Gruss
Sub Formeleinfügen()
'Mit dem Code "Cells(Rows.Count, 2).End(xlUp).Rows.Row"
'wird die letzte Zelle der Spalte A bestimmt
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Rows.Row
ActiveSheet.Range("w" & i).Formula = _
"=if((B" & i & "/F" & i & ")>=0,5;"JA";"")"
'und jetzt soll diese WENN-DANN-SONST-Formel eingesetzt werden
'=wenn((B1/F1)>=0,5;"JA";""), mit der obigen if klappts nicht
Next i
End Sub