Macro: If

  • Thread starter Thread starter Philipp Oberleitner
  • Start date Start date
P

Philipp Oberleitner

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
 
It is, but you have to get the syntax correct

If wks1.Cells(i, "O").Value = 0 And (wks1.Cells(i, "B").Value <>
"unbekannt")


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top