Thread: Macro: If
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Philipp Oberleitner Philipp Oberleitner is offline
external usenet poster
 
Posts: 14
Default Macro: If

Hi all,
i have a problem with the floowing code

For i = 5 To wks1.Cells(Rows.Count, "O").End(xlUp).Row
If wks1.Cells(i, "O").Value 10 Then
iAnz = iAnz + 1
wks2.Rows(iAnz).Value = wks1.Rows(i).Value
End If
Next i

For i = 5 To wks1.Cells(Rows.Count, "O").End(xlUp).Row
If wks1.Cells(i, "O").Value = 0 And (wks1.Cells(i, "B") Is Not "unbekannt")
Then
iAnz = iAnz + 1
wks2.Rows(iAnz).Value = wks1.Rows(i).Value
End If
Next i

The first part works fine but the second part brings a type error
Isnt it possible to examine if Column O has value 0 and Column B /=
"unbekannt"

Thanks alot in advance

philipp