![]() |
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 |
Macro: If
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) "Philipp Oberleitner" wrote in message ... 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 |
Macro: If
I think you need:
If wks1.Cells(i, "O").Value = 0 And (wks1.Cells(i, "B") < "unbekannt") "Philipp Oberleitner" wrote: 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 |
All times are GMT +1. The time now is 09:52 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com