• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

öğretmen nöbet çizelgesi

Katılım
11 Ocak 2006
Mesajlar
324
Değerli hocalarım
ekteki örnekte sayfa 2 deki iki makro birden çalışmıyor.Butondaki makro satırları
bir alta geçirmekte,diğer makroda açılır kutudaki ismi seçtiğimde aynı sütunda
ismi ikinci kez girdiğimde uyarı vermekte.Fakat butona basınca isimleri silmekte.
Bu iki makronun da çalışması için yardımcı olursanız sevinirim.
 

Ekli dosyalar

Bunu denermisiniz.?

Kod:
Dim deg As String
Private Sub CommandButton2_Click()
deg = 1
For i = 21 To 5 Step -1
Cells(i + 1, 2).Value = Cells(i, 2).Value
Cells(i + 1, 3).Value = Cells(i, 3).Value
Cells(i + 1, 4).Value = Cells(i, 4).Value
Cells(i + 1, 5).Value = Cells(i, 5).Value
Cells(i + 1, 6).Value = Cells(i, 6).Value
Next
Cells(6, 2) = Cells(21, 2)
Cells(6, 3) = Cells(21, 3)
Cells(6, 4) = Cells(21, 4)
Cells(6, 5) = Cells(21, 5)
Cells(6, 6) = Cells(21, 6)
Cells(21, 2) = ""
Cells(21, 3) = ""
Cells(21, 4) = ""
Cells(21, 5) = ""
Cells(21, 6) = ""
deg = 0
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Val(deg) = 0 Then
If Intersect(Target, [B6:F20]) Is Nothing Then Exit Sub
s = Application.WorksheetFunction.CountIf(Range(Cells(6, Target.Column), Cells(20, Target.Column)), Target)
If s > 1 Then
MsgBox " Bu Kişinin İSMİ Var", vbCritical + vbDefaultButton1 + vbOKOnly, "UYARI"
Target.Select
Target.Value = ""
Exit Sub
End If
End If
End Sub
 
Geri
Üst