DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
=EĞER((A$1-A4)>(A$1* 0,05);"-1";"+1")
Sub n()
yzd = CDbl(Cells(1, 1).Value) * 0.05
For i = 4 To 186
If CDbl(Cells(1, 1).Value) - CDbl(Cells(i, 1).Value) > yzd Then
Cells(i, 2).Value = "-1"
Else
Cells(i, 2).Value = "+1"
End If
Next
End Sub
Mu makroyu benim size gönderdiğim bir sutun için yapmıştık bunu yanyana 2500 sutun için yapabilirmiyiz.
Sub fd()
Dim satır, sütun, i As Long
Dim sf, sf1 As Worksheet
satır = 1
Set sf = Sheets("sayfa1")
Set sf1 = Sheets("sayfa2")
For sütun = 1 To [COLOR="Red"]3[/COLOR]
For i = 3 To sf.Cells(65536, sütun).End(xlUp).Row
If CDbl(sf.Cells(1, sütun).Value) <= CDbl(sf.Cells(i, sütun).Value) Then
If i < 11 Then
satır = satır + 1
sf1.Cells(satır, 1).Value = sf.Cells(2, sütun).Value
sf1.Cells(satır, 2).Value = "1"
sf1.Cells(satır, 3).Value = "0"
sf1.Cells(satır, 4).Value = sütun
GoTo atla
End If
If i > WorksheetFunction.CountA(Range("a:a")) - 11 Then
satır = satır + 1
sf1.Cells(satır, 1).Value = sf.Cells(2, sütun).Value
sf1.Cells(satır, 2).Value = "0"
sf1.Cells(satır, 3).Value = "1"
sf1.Cells(satır, 4).Value = sütun
GoTo atla
End If
satır = satır + 1
sf1.Cells(satır, 1).Value = sf.Cells(2, sütun).Value
sf1.Cells(satır, 2).Value = "0"
sf1.Cells(satır, 3).Value = "0"
sf1.Cells(satır, 4).Value = sütun
GoTo atla
End If
Next i
atla:
Next sütun
End Sub
Sayın fedeal çok teşekkür ederim tam isteğim budur. Fakat formülde ortada olursa (yani ilk on ve son on harici olursa) DL=0, DU=0 vermiyor Galiba onun kodunda bir yanlışlık. Çözemedim ilkinde aynı sayfada yaptığınızda çalışıyordu
Sub fd()
Dim satır, sütun, i As Long
Dim sf, sf1 As Worksheet
satır = 1
Set sf = Sheets("sayfa1")
Set sf1 = Sheets("sayfa2")
For sütun = 1 To 3
sf.Select
Cells(1, sütun).Select
For i = 3 To sf.Cells(65536, sütun).End(xlUp).Row
If CDbl(sf.Cells(1, sütun).Value) <= CDbl(sf.Cells(i, sütun).Value) Then
If i < 11 Then
satır = satır + 1
sf1.Cells(satır, 1).Value = sf.Cells(2, sütun).Value
sf1.Cells(satır, 2).Value = "1"
sf1.Cells(satır, 3).Value = "0"
sf1.Cells(satır, 4).Value = sütun
GoTo atla
End If
[COLOR="Red"]If i > WorksheetFunction.CountA(Range(Split(ActiveCell.Address, "$")(1) & ":" & Split(ActiveCell.Address, "$")(1))) - 11 Then[/COLOR]
satır = satır + 1
sf1.Cells(satır, 1).Value = sf.Cells(2, sütun).Value
sf1.Cells(satır, 2).Value = "0"
sf1.Cells(satır, 3).Value = "1"
sf1.Cells(satır, 4).Value = sütun
GoTo atla
End If
satır = satır + 1
sf1.Cells(satır, 1).Value = sf.Cells(2, sütun).Value
sf1.Cells(satır, 2).Value = "0"
sf1.Cells(satır, 3).Value = "0"
sf1.Cells(satır, 4).Value = sütun
GoTo atla
End If
Next i
atla:
Next sütun
sf1.Select
End Sub