Merhaba arkadaşlar bi makro düzenlemeye çalışıyorumda bir hata veriyor bir türlü çözümünü bulamadım yardımcı olabilicek varmı acaba ? Makronun sonundaki kalın yazılı yerdeki Erase kodu hata veriyor sarı renkle onaylamıyor acaba hata sebebi nedir ?
Sub Emre()
Dim dizi(), son%, a%, i%, b%, iy, ms
son = Range("I65536").End(3).Row
For i = 4 To son
iy = Split(Cells(i, "G"), "-")
ms = Split(Cells(i, "E"), " -")
ReDim Preserve dizi(1 To son, 3)
On Error Resume Next
dizi(b + 1, 0) = Trim(iy(0))
dizi(b + 1, 1) = Trim(iy(1))
dizi(b + 1, 2) = Trim(ms(0))
dizi(b + 1, 3) = Trim(ms(1))
Select Case dizi(b + 1, 0)
Case Is < dizi(b + 1, 1)
Cells(i, "N").Interior.ColorIndex = 44
Case Is = dizi(b + 1, 1)
Cells(i, "M").Interior.ColorIndex = 44
Case Is > dizi(b + 1, 1)
Cells(i, "L").Interior.ColorIndex = 44
End Select
Select Case dizi(b + 1, 2)
Case Is < dizi(b + 1, 3)
Cells(i, "K").Interior.ColorIndex = 44
Case Is = dizi(b + 1, 3)
Cells(i, "J").Interior.ColorIndex = 44
Case Is > dizi(b + 1, 3)
Cells(i, "I").Interior.ColorIndex = 44
End Select
If dizi(b + 1, 2) > 0 And dizi(b + 1, 3) > 0 Then
Cells(i, "V").Interior.ColorIndex = 44
Else
Cells(i, "U").Interior.ColorIndex = 44
End If
b = b + 1
Next i
Erase dizi: Erase iy: Erase ms: b = Empty: i = Empty: son = Empty
End Sub
Sub Emre()
Dim dizi(), son%, a%, i%, b%, iy, ms
son = Range("I65536").End(3).Row
For i = 4 To son
iy = Split(Cells(i, "G"), "-")
ms = Split(Cells(i, "E"), " -")
ReDim Preserve dizi(1 To son, 3)
On Error Resume Next
dizi(b + 1, 0) = Trim(iy(0))
dizi(b + 1, 1) = Trim(iy(1))
dizi(b + 1, 2) = Trim(ms(0))
dizi(b + 1, 3) = Trim(ms(1))
Select Case dizi(b + 1, 0)
Case Is < dizi(b + 1, 1)
Cells(i, "N").Interior.ColorIndex = 44
Case Is = dizi(b + 1, 1)
Cells(i, "M").Interior.ColorIndex = 44
Case Is > dizi(b + 1, 1)
Cells(i, "L").Interior.ColorIndex = 44
End Select
Select Case dizi(b + 1, 2)
Case Is < dizi(b + 1, 3)
Cells(i, "K").Interior.ColorIndex = 44
Case Is = dizi(b + 1, 3)
Cells(i, "J").Interior.ColorIndex = 44
Case Is > dizi(b + 1, 3)
Cells(i, "I").Interior.ColorIndex = 44
End Select
If dizi(b + 1, 2) > 0 And dizi(b + 1, 3) > 0 Then
Cells(i, "V").Interior.ColorIndex = 44
Else
Cells(i, "U").Interior.ColorIndex = 44
End If
b = b + 1
Next i
Erase dizi: Erase iy: Erase ms: b = Empty: i = Empty: son = Empty
End Sub
