- Katılım
- 20 Aralık 2019
- Mesajlar
- 2
- Excel Vers. ve Dili
- Excel 2016 Türkçe
Merhaba Arkadaşlar
Aşağıdaki kodu yazmaya uğraşıyorum.Kodu test edemedim çünkü "Compile Error :Next without for" hatası alıyorum.Bu hatayı nasıl giderebilirim?Ayrıca dizi yazmaya çalıştım onda da hatam olabilir.Ona da bakabilirseniz memnun olurum. Yardımcı olabileceklere şimdiden teşekkür ederim.
Private Sub Worksheet_Change(ByVal Target As Range)
sonsatir = Cells(Rows.Count, "B").End(xlUp).Row
For i = 2 To sonsatir
If Target.Column = 2 Then
If Cells(i, 3) = 8 And IsNumeric(Application.Match(Range("F" & Target.Row).Value, Array(9, 10), 0)) Then
Cells(i, 7) = Cells(i, 2) * 1.5 * 600 / 9000 * 372 / 1000
End If
If Cells(i, 3) = 8 And IsNumeric(Application.Match(Range("F" & Target.Row).Value, Array(12, 89), 0)) Then
Cells(i, 7) = Cells(i, 2) * 1.5 * 600 / 9000 * 372 / 1000
End If
If Cells(i, 3) = 8 And IsNumeric(Application.Match(Range("F" & Target.Row).Value, Array(24, 46, 47, 63, 86, 93), 0)) Then
Cells(i, 7) = Cells(i, 2) * 1.5 * 600 / 9000 * 372 / 1000
End If
Else: Cells(i, 7) = "kontrol et"
Next i
End Sub
Aşağıdaki kodu yazmaya uğraşıyorum.Kodu test edemedim çünkü "Compile Error :Next without for" hatası alıyorum.Bu hatayı nasıl giderebilirim?Ayrıca dizi yazmaya çalıştım onda da hatam olabilir.Ona da bakabilirseniz memnun olurum. Yardımcı olabileceklere şimdiden teşekkür ederim.
Private Sub Worksheet_Change(ByVal Target As Range)
sonsatir = Cells(Rows.Count, "B").End(xlUp).Row
For i = 2 To sonsatir
If Target.Column = 2 Then
If Cells(i, 3) = 8 And IsNumeric(Application.Match(Range("F" & Target.Row).Value, Array(9, 10), 0)) Then
Cells(i, 7) = Cells(i, 2) * 1.5 * 600 / 9000 * 372 / 1000
End If
If Cells(i, 3) = 8 And IsNumeric(Application.Match(Range("F" & Target.Row).Value, Array(12, 89), 0)) Then
Cells(i, 7) = Cells(i, 2) * 1.5 * 600 / 9000 * 372 / 1000
End If
If Cells(i, 3) = 8 And IsNumeric(Application.Match(Range("F" & Target.Row).Value, Array(24, 46, 47, 63, 86, 93), 0)) Then
Cells(i, 7) = Cells(i, 2) * 1.5 * 600 / 9000 * 372 / 1000
End If
Else: Cells(i, 7) = "kontrol et"
Next i
End Sub