• DİKKAT

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

iki koşullu aktarma

Katılım
11 Aralık 2008
Mesajlar
25
Excel Vers. ve Dili
2007
ustalar iyi günler merhaba şöyle bir problemim var bir kamu kurumunda muhasebe servisinde çalışıyorum bana bağlı 4 adet kantin var bu kantinlere para girişi yapmaya yetkili kendi satış sorumluları haricinde 3 kişi var bunlar şöyle

kantin 1 satış sorumlusu : abdullah
kantin 1'e para girişi yapmaya yetkili olan diğer kişiler : jale, nurgül, fatma

kantin 2 satış sorumlusu : ali (kantin 2'ye sadece ali giriş yapabilir)

kantin 3 satış sorumlusu : ahmet
kantin 3'e para girişi yapmaya yetkili olan diğer kişiler : jale, nurgül, fatma

kantin 4 satış sorumlusu : akın
kantin 4'e para girişi yapmaya yetkili olan diğer kişiler : jale, nurgül, fatma

dosyanın içinde göreceksiniz satış sorumluları para girince kantin 1, kantin 2, kantin 3, kantin 4 defterlerine kayıt yapılıyor bunda sorun yok. diğerleri para girince kantin 1 n, kantin 3 n, kantin 4 n defterine kayıt yapılsın istiyorum ama olmuyor herhangi biri giriş yapınca kantin 1 n, kantin 3 n, kantin 4 n defterlerinin hepsine kayıt yapılıyor





'KANTİN 1 PARA TESLİM DEFTERİNE

If ComboBox2 = "KANTİN 1" And ComboBox3 = "ABDULLAH" Then
Dim alan
alan = 6
While Sheets("KANTİN1").Cells(alan, 5) <> ""
alan = alan + 1
Wend
Sheets("KANTİN1").Cells(alan, 4) = DTPicker1
Sheets("KANTİN1").Cells(alan, 5) = TextBox2
Sheets("KANTİN1").Cells(alan, 7) = ComboBox3
Else
Cancel = True
End If

'KANTİN 2 PARA TESLİM DEFTERİNE

If ComboBox2 = "KANTİN 2" Then
Dim bolum
bolum = 6
While Sheets("KANTİN2").Cells(bolum, 5) <> ""
bolum = bolum + 1
Wend
Sheets("KANTİN2").Cells(bolum, 4) = DTPicker1
Sheets("KANTİN2").Cells(bolum, 5) = TextBox2
Sheets("KANTİN2").Cells(bolum, 7) = ComboBox3
Else
Cancel = True
End If


'KANTİN 3 PARA TESLİM DEFTERİNE

If ComboBox2 = "KANTİN 3" And ComboBox3 = "AHMET" Then
Dim bol
bol = 6
While Sheets("KANTİN3").Cells(bol, 5) <> ""
bol = bol + 1
Wend
Sheets("KANTİN3").Cells(bol, 4) = DTPicker1
Sheets("KANTİN3").Cells(bol, 5) = TextBox2
Sheets("KANTİN3").Cells(bol, 7) = ComboBox3
Else
Cancel = True
End If



'KANTİN 4 PARA TESLİM DEFTERİNE

If ComboBox2 = "KANTİN 4" And ComboBox3 = "AKIN" Then
Dim kolum
kolum = 6
While Sheets("KANTİN4").Cells(kolum, 5) <> ""
kolum = kolum + 1
Wend
Sheets("KANTİN4").Cells(kolum, 4) = DTPicker1
Sheets("KANTİN4").Cells(kolum, 5) = TextBox2
Sheets("KANTİN4").Cells(kolum, 7) = ComboBox3
Else
Cancel = True
End If



'KANTİN 1 N PARA TESLİM DEFTERİNE

If ComboBox2 = "KANTİN 1" And ComboBox3 = "JALE" Or ComboBox3 = "NURGÜL" Or ComboBox3 = "FATMA" Then

Dim alanm
alanm = 6
While Sheets("KANTİN1 N").Cells(alanm, 5) <> ""
alanm = alanm + 1
Wend
Sheets("KANTİN1 N").Cells(alanm, 4) = DTPicker1
Sheets("KANTİN1 N").Cells(alanm, 5) = TextBox2
Sheets("KANTİN1 N").Cells(alanm, 7) = ComboBox3
Else
Cancel = True
End If



'KANTİN 3 N PARA TESLİM DEFTERİNE

If ComboBox2 = "KANTİN 3" And ComboBox3 = "JALE" Or ComboBox3 = "NURGÜL" Or ComboBox3 = "FATMA" Then

Dim bolh
bolh = 6
While Sheets("KANTİN3 N").Cells(bolh, 5) <> ""
bolh = bolh + 1
Wend
Sheets("KANTİN3 N").Cells(bolh, 4) = DTPicker1
Sheets("KANTİN3 N").Cells(bolh, 5) = TextBox2
Sheets("KANTİN3 N").Cells(bolh, 7) = ComboBox3
Else
Cancel = True
End If


'KANTİN 4 N PARA TESLİM DEFTERİNE

If ComboBox2 = "KANTİN 4" And ComboBox3 = "JALE" Or ComboBox3 = "NURGÜL" Or ComboBox3 = "FATMA" Then

Dim kolumg
kolumg = 6
While Sheets("KANTİN4 N").Cells(kolumg, 5) <> ""
kolumg = kolumg + 1
Wend
Sheets("KANTİN4 N").Cells(kolumg, 4) = DTPicker1
Sheets("KANTİN4 N").Cells(kolumg, 5) = TextBox2
Sheets("KANTİN4 N").Cells(kolumg, 7) = ComboBox3
Else
Cancel = True
End If



yukarıda görmüş olduğunuz kodları kendi kafama göre yazdım ama satış sorumluları haricinde biri giriş yapınca sonu n harfi ile biten defterlerin hepsine kayıt yapıyor.

net olarak istediğim şudur :

combobox2=kantin 1 ve combobox3=abdullah ise kantin 1 defterine kayıt
combobox2=kantin 1 ve combobox3=jale ise kantin 1 n defterine kayıt
combobox2=kantin 1 ve combobox3=nurgül ise kantin 1 n defterine kayıt
combobox2=kantin 1 ve combobox3=fatma ise kantin 1 n defterine kayıt

combobox2=kantin 3 ve combobox3=ahmet ise kantin 3 defterine kayıt
combobox2=kantin 3 ve combobox3=jale ise kantin 3 n defterine kayıt
combobox2=kantin 3 ve combobox3=nurgül ise kantin 3 n defterine kayıt
combobox2=kantin 3 ve combobox3=fatma ise kantin 3 n defterine kayıt

combobox2=kantin 4 ve combobox3=akın ise kantin 4 defterine kayıt
combobox2=kantin 4 ve combobox3=jale ise kantin 4 n defterine kayıt
combobox2=kantin 4 ve combobox3=nurgül ise kantin 4 n defterine kayıt
combobox2=kantin 4 ve combobox3=fatma ise kantin 4 n defterine kayıt


yardımlarınız için teşekür ederim eminim or yada and gibi basit birşeyin kullanımı yanlış olsa gerek ama ben bulamadım okyanusları geçip denizlerde boğuldum dosyamın çalışması için gerekli diğer ekler ekte mevcut (dtpicker, ytl eklentisi ve diğer ocx'ler)
iyi günler
 

Ekli dosyalar

kodu aşağıdaki mesajda düzelttim
 
hoca eline sağlık

ElseIf ComboBox3 = "JALE" And ComboBox3 = "NURGÜL" And ComboBox3 = "FATMA" Then

bu satırdaki And leri or ile değiştirince kayıt yapıyor fakat bu seferde bütün kayıtları ilk kaydın üstüne yapıyor yani kayıtlar aşağı doğru saklanmıyor sadece tek satıra çalışıyor
 
bunu denermisiniz.

If ComboBox2 = "KANTİN 1" Then
sat = WorksheetFunction.CountA(Worksheets("KANTİN1"). Range("E6:E204")) + 6
If ComboBox3 = "ABDULLAH" Then
Sheets("KANTİN1").Cells(sat, 4) = DTPicker1
Sheets("KANTİN1").Cells(sat, 5) = TextBox2
Sheets("KANTİN1").Cells(sat, 7) = ComboBox3
ElseIf ComboBox3 = "JALE" Or ComboBox3 = "NURGÜL" Or ComboBox3 = "FATMA" Then
sat1 = WorksheetFunction.CountA(Worksheets("KANTİN1 N"). Range("E6:E204")) + 6
Sheets("KANTİN1 N").Cells(sat1, 4) = DTPicker1
Sheets("KANTİN1 N").Cells(sat1, 5) = TextBox2
Sheets("KANTİN1 N").Cells(sat1, 7) = ComboBox3
End If
End If
If ComboBox2 = "KANTİN 3" Then
sat = WorksheetFunction.CountA(Worksheets("KANTİN3"). Range("E6:E204")) + 6
If ComboBox3 = "AHMET" Then
Sheets("KANTİN3").Cells(sat, 4) = DTPicker1
Sheets("KANTİN3").Cells(sat, 5) = TextBox2
Sheets("KANTİN3").Cells(sat, 7) = ComboBox3
ElseIf ComboBox3 = "JALE" Or ComboBox3 = "NURGÜL" Or ComboBox3 = "FATMA" Then
sat1 = WorksheetFunction.CountA(Worksheets("KANTİN3 N"). Range("E6:E204")) + 6
Sheets("KANTİN3 N").Cells(sat1, 4) = DTPicker1
Sheets("KANTİN3 N").Cells(sat1, 5) = TextBox2
Sheets("KANTİN3 N").Cells(sat1, 7) = ComboBox3
End If
End If
If ComboBox2 = "KANTİN 4" Then
sat = WorksheetFunction.CountA(Worksheets("KANTİN4"). Range("E6:E204")) + 6
If ComboBox3 = "AKIN" Then
Sheets("KANTİN4").Cells(sat, 4) = DTPicker1
Sheets("KANTİN4").Cells(sat, 5) = TextBox2
Sheets("KANTİN4").Cells(sat, 7) = ComboBox3
ElseIf ComboBox3 = "JALE" Or ComboBox3 = "NURGÜL" Or ComboBox3 = "FATMA" Then
sat1 = WorksheetFunction.CountA(Worksheets("KANTİN4 N"). Range("E6:E204")) + 6
Sheets("KANTİN4 N").Cells(sat1, 4) = DTPicker1
Sheets("KANTİN4 N").Cells(sat1, 5) = TextBox2
Sheets("KANTİN4 N").Cells(sat1, 7) = ComboBox3
End If
End If
 
hocam eline sağlık oldu tşk ederim cevap verenlerin yardım edenlerin çok olsun
 
Geri
Üst