merhaba arkadaşlar
benim bir adet kodum var bu kodda bir aralıkta tanımladığım sayıyı arattırıyorum.Fakat aynı sayı iki yada daha fazla olduğu zaman belirlediğim hücreye 1 arttırım yapmasını istiyorum.Kendi hazırladığım kod ile arattığım sayı varsa 1 adet arttırım yapıyor fakat o sayıdan 2 adet yada daha fazla olduğu zaman ne kadar bulduğu sayı varsa o kadar arttırım yapmasını istiyorum.Kod örneği aşağıdadır.
teşekkürler
Sub sonuc2()
For a = 1 To 8
For b = 2 To 50
If (Not Cells(b, a + 75).Value = "" And Not Cells(b, 87).Value = "") Then
Cells(a + 1, 127).Value = Cells(a + 1, 127) + 1
End If
Next b
Next a
Set bul = Range("DW1
W20").Find(6)
On Error Resume Next
If Not bul Is Nothing Then
Range("ED3").Value = Range("ED3") + 1
End If
Set bul = Range("DW1
W20").Find(7)
If Not bul Is Nothing Then
Range("ED4").Value = Range("ED4") + 1
End If
On Error Resume Next
Set bul = Range("DW1
W20").FindNext(bul)
If Not bul Is Nothing Then
Range("ED4").Value = Range("ED4") + 1
End If
Set bul = Range("DW1
W20").Find(8)
If Not bul Is Nothing Then
Range("ED5").Value = Range("ED5") + 1
End If
On Error Resume Next
Set bul = Range("DW1
W20").FindNext(bul)
If Not bul Is Nothing Then
Range("ED5").Value = Range("ED5") + 1
End If
Set bul = Range("DW1
W20").Find(9)
If Not bul Is Nothing Then
Range("ED6").Value = Range("ED6") + 1
End If
On Error Resume Next
Set bul = Range("DW1
W20").FindNext(bul)
If Not bul Is Nothing Then
Range("ED6").Value = Range("ED6") + 1
End If
Set bul = Range("DW1
W20").Find(10)
If Not bul Is Nothing Then
Range("ED7").Value = Range("ED7") + 1
End If
On Error Resume Next
Set bul = Range("DW1
W20").FindNext(bul)
If Not bul Is Nothing Then
Range("ED7").Value = Range("ED7") + 1
End If
End Sub
benim bir adet kodum var bu kodda bir aralıkta tanımladığım sayıyı arattırıyorum.Fakat aynı sayı iki yada daha fazla olduğu zaman belirlediğim hücreye 1 arttırım yapmasını istiyorum.Kendi hazırladığım kod ile arattığım sayı varsa 1 adet arttırım yapıyor fakat o sayıdan 2 adet yada daha fazla olduğu zaman ne kadar bulduğu sayı varsa o kadar arttırım yapmasını istiyorum.Kod örneği aşağıdadır.
teşekkürler
Sub sonuc2()
For a = 1 To 8
For b = 2 To 50
If (Not Cells(b, a + 75).Value = "" And Not Cells(b, 87).Value = "") Then
Cells(a + 1, 127).Value = Cells(a + 1, 127) + 1
End If
Next b
Next a
Set bul = Range("DW1
On Error Resume Next
If Not bul Is Nothing Then
Range("ED3").Value = Range("ED3") + 1
End If
Set bul = Range("DW1
If Not bul Is Nothing Then
Range("ED4").Value = Range("ED4") + 1
End If
On Error Resume Next
Set bul = Range("DW1
If Not bul Is Nothing Then
Range("ED4").Value = Range("ED4") + 1
End If
Set bul = Range("DW1
If Not bul Is Nothing Then
Range("ED5").Value = Range("ED5") + 1
End If
On Error Resume Next
Set bul = Range("DW1
If Not bul Is Nothing Then
Range("ED5").Value = Range("ED5") + 1
End If
Set bul = Range("DW1
If Not bul Is Nothing Then
Range("ED6").Value = Range("ED6") + 1
End If
On Error Resume Next
Set bul = Range("DW1
If Not bul Is Nothing Then
Range("ED6").Value = Range("ED6") + 1
End If
Set bul = Range("DW1
If Not bul Is Nothing Then
Range("ED7").Value = Range("ED7") + 1
End If
On Error Resume Next
Set bul = Range("DW1
If Not bul Is Nothing Then
Range("ED7").Value = Range("ED7") + 1
End If
End Sub
