- Katılım
- 1 Aralık 2007
- Mesajlar
- 665
- Excel Vers. ve Dili
- Office 2003 excel Türkçe
Merhaba,
Aşağıdaki kodları formdan buldum, Bunların daha kısa hallerinin kullanımı için yardımcı olur musunuz?
For i = 1 To 369
If Cells(i, 14).Value < 0 Then Cells(i, 1).Interior.ColorIndex = 15 Else Cells(i, 1).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 2).Interior.ColorIndex = 15 Else Cells(i, 2).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 3).Interior.ColorIndex = 15 Else Cells(i, 3).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 4).Interior.ColorIndex = 15 Else Cells(i, 4).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 5).Interior.ColorIndex = 15 Else Cells(i, 5).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 6).Interior.ColorIndex = 15 Else Cells(i, 6).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 7).Interior.ColorIndex = 15 Else Cells(i, 7).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 8).Interior.ColorIndex = 15 Else Cells(i, 8).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 9).Interior.ColorIndex = 15 Else Cells(i, 9).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 10).Interior.ColorIndex = 15 Else Cells(i, 10).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 11).Interior.ColorIndex = 15 Else Cells(i, 11).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 12).Interior.ColorIndex = 15 Else Cells(i, 12).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 13).Interior.ColorIndex = 15 Else Cells(i, 13).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 14).Interior.ColorIndex = 15 Else Cells(i, 14).Interior.ColorIndex = xlNone
Next
Aşağıdaki kodları formdan buldum, Bunların daha kısa hallerinin kullanımı için yardımcı olur musunuz?
For i = 1 To 369
If Cells(i, 14).Value < 0 Then Cells(i, 1).Interior.ColorIndex = 15 Else Cells(i, 1).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 2).Interior.ColorIndex = 15 Else Cells(i, 2).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 3).Interior.ColorIndex = 15 Else Cells(i, 3).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 4).Interior.ColorIndex = 15 Else Cells(i, 4).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 5).Interior.ColorIndex = 15 Else Cells(i, 5).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 6).Interior.ColorIndex = 15 Else Cells(i, 6).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 7).Interior.ColorIndex = 15 Else Cells(i, 7).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 8).Interior.ColorIndex = 15 Else Cells(i, 8).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 9).Interior.ColorIndex = 15 Else Cells(i, 9).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 10).Interior.ColorIndex = 15 Else Cells(i, 10).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 11).Interior.ColorIndex = 15 Else Cells(i, 11).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 12).Interior.ColorIndex = 15 Else Cells(i, 12).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 13).Interior.ColorIndex = 15 Else Cells(i, 13).Interior.ColorIndex = xlNone
If Cells(i, 14).Value < 0 Then Cells(i, 14).Interior.ColorIndex = 15 Else Cells(i, 14).Interior.ColorIndex = xlNone
Next
