• DİKKAT

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

Textboxa iki değer atama

Katılım
5 Eylül 2007
Mesajlar
1,247
Excel Vers. ve Dili
ofis 2010
iyi akşamlar, hazırlamakta olduğun userformda takıldığım yer oldu.
Kod:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
On Error Resume Next
'If ComboBox1 <> "" And TextBox1 <> "" And TextBox2 <> "" And ComboBox2 <> "" And TextBox4 <> "" And TextBox3 <> "" And TextBox5 <> "" And TextBox6 <> "" Then

Set S1 = ThisWorkbook.Worksheets("Envanter")
sonsatir = S1.Range("B65536").End(xlUp).Row + 1
S1.Cells(sonsatir, "B") = TextBox1.Text 'Tarih
S1.Cells(sonsatir, "C") = TextBox2.Text 'Fatura No
S1.Cells(sonsatir, "D") = ComboBox1.Text ' Kumaş Cinsi
S1.Cells(sonsatir, "I") = ComboBox2.Text 'Mamul Cinsi
S1.Cells(sonsatir, "K") = TextBox3.Value * TextBox9.Value
S1.Cells(sonsatir, "M") = TextBox5.Value * TextBox3.Value
S1.Cells(sonsatir, "J") = Format(CLng(CDbl(TextBox3.Value)))
Application.ScreenUpdating = True
MsgBox "Veri Girişi Yapıldı", vbOKOnly
ComboBox1.SetFocus

TextBox1.SelLength = 0
With TextBox1
.MaxLength = 10
.EnterFieldBehavior = fmEnterFieldBehaviorRecallSelection
.Text = "##.##.2017"
.SelStart = 0
.SelLength = 1
TextBox3 = Empty
TextBox5 = Empty
End With
End Sub
iki textboxtaki değere göre çarpma işlemi yaptırırken command 'a ek olarak kullandığın iki textbox'a
Kod:
Private Sub TextBox3_Change()
If TextBox3 = "" Then TextBox3 = 0
If TextBox9 = "" Then TextBox9 = 0
miktar = TextBox3 * 1
fiyat = TextBox9 * 1
TextBox4 = Format(miktar * fiyat, "#,##0.00")
End Sub
ve
Kod:
Private Sub Textbox9_change()
If TextBox3 = "" Then TextBox3 = 0
If TextBox9 = "" Then TextBox9 = 0
miktar = TextBox3 * 1
fiyat = TextBox9 * 1
TextBox4 = Format(miktar * fiyat, "#,##0.00")
End Sub
yazarak işlemi sorunsuz yapıyorum. ancak textbox3' ü aynı userformda iki defa kullanmam gerekiyor. sorunu nasıl çözebilirim. teşekkürler
 

Ekli dosyalar

  • Yeni_form.jpg
    Yeni_form.jpg
    89.2 KB · Görüntüleme: 4
Geri
Üst