- Katılım
- 18 Ağustos 2007
- Mesajlar
- 22,184
- Excel Vers. ve Dili
-
Microsoft 365 Tr
Ofis 2016 Tr
Bu şekilde dener misiniz.
Kod:
Private Sub Worksheet_Calculate()
Dim a, b, alan, s As Long, son As Long, i As Long
With Application
.ScreenUpdating = False
.Calculation = xlManual
.EnableEvents = False
End With
a = Range("a2").Value
b = Range("b2").Value
son = Cells(Rows.Count, "A").End(xlUp).Row
alan = Range("A8:T" & son).Value
ReDim dizi(1 To son, 1 To 20)
For i = LBound(alan) To UBound(alan)
s = s + 1
If (alan(i, 3) < a Or alan(i, 3) > b) And alan(i, 20) = "0" Then
dizi(s, 1) = alan(i, 1)
Else
dizi(s, 1) = alan(i, 2)
End If
Next i
Range("B8").Resize(s, 1) = dizi
With Application
.Calculation = xlAutomatic
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub