sınıf atlatma

Katılım
29 Ocak 2006
Mesajlar
138
Excel Vers. ve Dili
2003 türkçe
herkese iyi bayramlar
tek bir tuşla öğrencilerin bulundukları sınıftan bir üst sınıfa atlatmak için aşağıdaki kodları denediğimde bütün öğrencileri şubesine göre 6/a,6/b,6/c,6/d sınıflarına atlatıyor.yani 1/a sınıfındaki öğrenci 6/a ya geçiyor.nasıl bir kod bu işi halleder acaba,yardımlarınızı bekliyorum.
Cells.Replace what:="1/a", replacement:="2/a"
Cells.Replace what:="1/b", replacement:="2/b"
Cells.Replace what:="1/c", replacement:="2/c"
Cells.Replace what:="1/d", replacement:="2/d"
Cells.Replace what:="2/a", replacement:="3/a"
Cells.Replace what:="2/b", replacement:="3/b"
Cells.Replace what:="2/c", replacement:="3/c"
Cells.Replace what:="2/d", replacement:="3/d"
Cells.Replace what:="3/a", replacement:="4/a"
Cells.Replace what:="3/b", replacement:="4/b"
Cells.Replace what:="3/c", replacement:="4/c"
Cells.Replace what:="3/d", replacement:="4/d"
Cells.Replace what:="4/a", replacement:="5/a"
Cells.Replace what:="4/b", replacement:="5/b"
Cells.Replace what:="4/c", replacement:="5/c"
Cells.Replace what:="4/d", replacement:="5/d"
Cells.Replace what:="5/a", replacement:="6/a"
Cells.Replace what:="5/b", replacement:="6/b"
Cells.Replace what:="5/c", replacement:="6/c"
Cells.Replace what:="5/d", replacement:="6/d"
 

Necdet

Moderatör
Yönetici
Katılım
4 Haziran 2005
Mesajlar
15,372
Excel Vers. ve Dili
Ofis 365 Türkçe
Sayın xxihsidxx

Bilgilerin A sütununda olduğunu varsayarak ve sadece A sınıfları için aşağıdaki kodu düşündüm, siz geliştirebilirsiniz.

6. sınıftakileri de siliyor.

Kod:
Public Sub degistir()
For i = 1 To [A65536].End(3).Row
    deger = Cells(i, 1)
    Select Case deger
        Case Is = "1/a"
            deger = "2/a"
        Case Is = "2/a"
            deger = "3/a"
        Case Is = "3/a"
            deger = "4/a"
        Case Is = "4/a"
            deger = "5/a"
        Case Is = "5/a"
            deger = "6/a"
        Case Is = "6/a"
            deger = "sil"
    End Select
    If deger = "sil" Then
        Rows(i).Delete
    Else
        Cells(i, 1) = deger
    End If
Next i
End Sub
 

Haluk

Özel Üye
Katılım
7 Temmuz 2004
Mesajlar
12,406
Excel Vers. ve Dili
64 Bit 2010 - İngilizce
+
Google Sheets
+
JScript
Altın Üyelik Bitiş Tarihi
Sondan başa doğru yazarak deneyin ...

Kod:
    Cells.Replace what:="5/a", replacement:="6/a"
    Cells.Replace what:="5/b", replacement:="6/b"
    Cells.Replace what:="5/c", replacement:="6/c"
    Cells.Replace what:="5/d", replacement:="6/d"
    Cells.Replace what:="4/a", replacement:="5/a"
    Cells.Replace what:="4/b", replacement:="5/b"
    Cells.Replace what:="4/c", replacement:="5/c"
    Cells.Replace what:="4/d", replacement:="5/d"
    Cells.Replace what:="3/a", replacement:="4/a"
    Cells.Replace what:="3/b", replacement:="4/b"
    Cells.Replace what:="3/c", replacement:="4/c"
    Cells.Replace what:="3/d", replacement:="4/d"
    Cells.Replace what:="2/a", replacement:="3/a"
    Cells.Replace what:="2/b", replacement:="3/b"
    Cells.Replace what:="2/c", replacement:="3/c"
    Cells.Replace what:="2/d", replacement:="3/d"
    Cells.Replace what:="1/a", replacement:="2/a"
    Cells.Replace what:="1/b", replacement:="2/b"
    Cells.Replace what:="1/c", replacement:="2/c"
    Cells.Replace what:="1/d", replacement:="2/d"
 
Katılım
29 Ocak 2006
Mesajlar
138
Excel Vers. ve Dili
2003 türkçe
Necdet Bey,Haluk Bey çok teşekkür ederim.iyi bayramlar.
 
Son düzenleme:
Üst