• DİKKAT

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

Formda Girilen Bİlgileri Tablonun En altına Kaydetme

Katılım
14 Ağustos 2023
Mesajlar
29
Excel Vers. ve Dili
2021 - Türkçe
Merhabalar Resimdeki Gibi D7 ile P7 sutünları arasında bir tablom bulunuyor. Ürün Ekle Butonuna Basınca 2. Resimdeki Form Açılıyor ve Formda Girilen Değerleri Tablomun en altına eklemesini nasıl yapabilirim bir şeyler denedim fakat başaramadım. Şimdiden Yardımcı olan herkese teşekkür ederim.
yoBhZ8.png


yoBsQj.png
 
Örnek bir nesnedeki veriyi sayfaya aktarma kodu.. Gerisini siz halledersiniz.

C++:
Option Explicit

Private Sub CommandButton1_Click()
    Dim S1 As Worksheet, Last_Row As Long
   
    Set S1 = Sheets("Sheet1")
   
    Last_Row = S1.Cells(S1.Rows.Count, "D").End(3).Row + 1
   
    S1.Cells(Last_Row, "D") = TextBox1.Value
    Rem Üstteki satıra bakarak gerisini siz oluşturabilirsiniz.
   
    Set S1 = Nothing
   
    MsgBox "Kayıt işlemi tamamlanmıştır.", vbInformation
End Sub
 
Merhaba
Deneyin
C++:
Private Sub CommandButton1_Click()
SonSat = Sheets("Sayfa1").Range("A1048576").End(3).Row
Range("A" & SonSat + 1) = TextBox1.Text
TextBox1 = Empty
End Sub
 
Örnek bir nesnedeki veriyi sayfaya aktarma kodu.. Gerisini siz halledersiniz.

C++:
Option Explicit

Private Sub CommandButton1_Click()
    Dim S1 As Worksheet, Last_Row As Long
  
    Set S1 = Sheets("Sheet1")
  
    Last_Row = S1.Cells(S1.Rows.Count, "D").End(3).Row + 1
  
    S1.Cells(Last_Row, "D") = TextBox1.Value
    Rem Üstteki satıra bakarak gerisini siz oluşturabilirsiniz.
  
    Set S1 = Nothing
  
    MsgBox "Kayıt işlemi tamamlanmıştır.", vbInformation
End Sub


Teşekkür ederim kodumu alttaki gibi güncelledim ve sorunsuz çalışıyor.




C++:
Private Sub CommandButton1_Click()
    Dim S1 As Worksheet, Last_Row As Long
  
    Set S1 = Sheets("SAYFANIZIN_ADI")
  
    Last_Row = S1.Cells(S1.Rows.Count, "D").End(3).Row + 1
  
    S1.Cells(Last_Row, "D") = TextBox1.Value
    S1.Cells(Last_Row, "E") = TextBox2.Value
    S1.Cells(Last_Row, "F") = TextBox3.Value
    S1.Cells(Last_Row, "G") = TextBox4.Value
    S1.Cells(Last_Row, "H") = TextBox5.Value
    S1.Cells(Last_Row, "I") = TextBox6.Value
    S1.Cells(Last_Row, "J") = TextBox7.Value
    S1.Cells(Last_Row, "K") = TextBox8.Value
    S1.Cells(Last_Row, "L") = TextBox9.Value
    S1.Cells(Last_Row, "M") = TextBox10.Value
    S1.Cells(Last_Row, "N") = TextBox11.Value
     S1.Cells(Last_Row, "O") = TextBox12.Value
    
    
  
  
    Set S1 = Nothing
  
    MsgBox "Kayıt işlemi tamamlanmıştır.", vbInformation
End Sub
 
Ek bilgi...

Ardışık giden nesne ve hücreler için For-Next döngüsü kullanarak kodları kısaltabilirsiniz.

Döngüler yazılımın bel kemiğidir..
 
Örnek bir nesnedeki veriyi sayfaya aktarma kodu.. Gerisini siz halledersiniz.

C++:
Option Explicit

Private Sub CommandButton1_Click()
    Dim S1 As Worksheet, Last_Row As Long
 
    Set S1 = Sheets("Sheet1")
 
    Last_Row = S1.Cells(S1.Rows.Count, "D").End(3).Row + 1
 
    S1.Cells(Last_Row, "D") = TextBox1.Value
    Rem Üstteki satıra bakarak gerisini siz oluşturabilirsiniz.
 
    Set S1 = Nothing
 
    MsgBox "Kayıt işlemi tamamlanmıştır.", vbInformation
End Sub
Bu Forma Şöyle bir düzenleme yapmam gerekirse nasıl bir yol izlemem gerekir ?
yoG6bf.png


option butonlarda TL seçilirse alış fiyatı "I" sütununa Usd seçilirse "J" sütununa Euro Seçerse "K" sütununa kaydedecek. (Alış Fiyatı Textbox7)
 
Deneyiniz.

C++:
Dim My_Column As String
If OptionButton1 = True Then
     My_Column = "I"
ElseIf OptionButton2 = True Then
     My_Column = "J"
ElseIf OptionButton3 = True Then
     My_Column = "K"
End If

S1.Cells(Last_Row, My_Column) = TextBox7.Value
 
Deneyiniz.

C++:
Dim My_Column As String
If OptionButton1 = True Then
     My_Column = "I"
ElseIf OptionButton2 = True Then
     My_Column = "J"
ElseIf OptionButton3 = True Then
     My_Column = "K"
End If

S1.Cells(Last_Row, My_Column) = TextBox7.Value
Teşekkür ederim çalışıyor.
 
Geri
Üst