• DİKKAT

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

Textbox' da ki veriyi tabloya yazdırma

  • Konbuyu başlatan Konbuyu başlatan bhdr
  • Başlangıç tarihi Başlangıç tarihi
Katılım
26 Ekim 2016
Mesajlar
87
Excel Vers. ve Dili
Excel 2010-2013
Herkese Merhaba;

Bir kaç gündür üzerinde çalıştığım makroda sizlerinde yardımıyla sona doğru geldim.Ancak aşağıdaki yazmış olduğum bir noktada takıldım.Gerek mantıksal gerek işlevsel olarak.

-Excel içerisinde ki yemek günü sayfasında yer alan yemek günü girişi butonuna bastığımda çıkan userformda, combobax a yazılı isimlerin sicil nolarını buldurabildim.

Ancak buldurduğum bu sicil numarasının userformda bulunan yemek günü kutucuğuna yazılı olan değeri alıp, yine excel yemek günü sayfasındaki sicil no ile eşleştirilip "E" sütununda ki karşılığına yazdırmasını istiyorum.

Yardımlarınız için teşekkür ederim.
 

Ekli dosyalar

"Yemek günü" sayfası "e" sütununda formül var; ama herhalde değişecek,
ve "A" sütununda mükerrer sicil yok ise (varsa ilk sicil karşısına)
"userform2" kod sayfasına ekleyip "yemek gir butonu" ile denermisiniz?
Kod:
[SIZE="2"]Private Sub CommandButton2_Click()
If TextBox1 = "" Then MsgBox "Sicil no eksik": Exit Sub
If TextBox2 = "" Or IsNumeric(TextBox2) = False _
Then MsgBox "Gün sayısı yok veya sayısal değil": Exit Sub
Dim s As Long
Set s1 = Sheets("YEMEK GÜNÜ")
s = TextBox1
On Error Resume Next
s = Application.Match(s, s1.Columns("A"), 0)
s1.Cells(s, "E") = TextBox2.Value
If Err > 0 Then MsgBox "sicil bulunamadı"
End Sub[/SIZE]

eğer filtreleme olmadan kullanırsanız
Kod:
[SIZE="2"]Private Sub CommandButton2_Click()
If TextBox1 = "" Then MsgBox "Sicil no eksik": Exit Sub
If TextBox2 = "" Or IsNumeric(TextBox2) = False _
Then MsgBox "Gün sayısı yok veya sayısal değil": Exit Sub
Set s1 = Sheets("YEMEK GÜNÜ")
rw = s1.Cells(Rows.Count, "A").End(3).Row
Set r = s1.Range("A1:A" & rw).Find(TextBox1.Text, , xlValues, xlWhole)
If Not r Is Nothing Then
s1.Cells(r.Row, "E") = TextBox2.Value
Else
MsgBox "sicil bulunamadı"
End If
End Sub[/SIZE]
 
"Yemek günü" sayfası "e" sütununda formül var; ama herhalde değişecek,
ve "A" sütununda mükerrer sicil yok ise (varsa ilk sicil karşısına)
"userform2" kod sayfasına ekleyip "yemek gir butonu" ile denermisiniz?
Kod:
[SIZE="2"]Private Sub CommandButton2_Click()
If TextBox1 = "" Then MsgBox "Sicil no eksik": Exit Sub
If TextBox2 = "" Or IsNumeric(TextBox2) = False _
Then MsgBox "Gün sayısı yok veya sayısal değil": Exit Sub
Dim s As Long
Set s1 = Sheets("YEMEK GÜNÜ")
s = TextBox1
On Error Resume Next
s = Application.Match(s, s1.Columns("A"), 0)
s1.Cells(s, "E") = TextBox2.Value
If Err > 0 Then MsgBox "sicil bulunamadı"
End Sub[/SIZE]

eğer filtreleme olmadan kullanırsanız
Kod:
[SIZE="2"]Private Sub CommandButton2_Click()
If TextBox1 = "" Then MsgBox "Sicil no eksik": Exit Sub
If TextBox2 = "" Or IsNumeric(TextBox2) = False _
Then MsgBox "Gün sayısı yok veya sayısal değil": Exit Sub
Set s1 = Sheets("YEMEK GÜNÜ")
rw = s1.Cells(Rows.Count, "A").End(3).Row
Set r = s1.Range("A1:A" & rw).Find(TextBox1.Text, , xlValues, xlWhole)
If Not r Is Nothing Then
s1.Cells(r.Row, "E") = TextBox2.Value
Else
MsgBox "sicil bulunamadı"
End If
End Sub[/SIZE]

İkinci kod işime yaradı, çok teşekkür ederim.
 
Geri
Üst