UserForm

Katılım
9 Aralık 2006
Mesajlar
75
Excel Vers. ve Dili
türkçe
Sn.Arkadaşlar

Ekte gönderdiğim örnektende anlaşılacağı üzere userformdaki bilgilere girildiğinde hangi sayfaya seçildiyse oraya yazmasını istiyorum. Sonra bu ayrı sayfalardaki toplamı userformdaki toplama yazmasını istiyorum.Yardımlarınız için şimdiden teşekür eder saygılar sunarım...
 

Ekli dosyalar

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,248
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Örnek dosyayı inceleyiniz.:cool:
Kod:
Private Sub ComboBox1_Click()
TextBox1.Text = "S" & ComboBox1.ListIndex + 1 & "-" & _
WorksheetFunction.Max(Sheets(ComboBox1.Value).Range("A2:A65536")) + 1
TextBox6.Text = Format(WorksheetFunction.Sum(Sheets(ComboBox1.Value).Range("F2:F65536")), "#,##0.00")


End Sub

Private Sub Image1_Click()
Dim sat As Long, no As Long

If Not IsDate(TextBox2.Text) Then
    MsgBox "Yanlış tarih girişi." & vbLf & "Dooğru tarih giriniz.", vbCritical, "UYARI"
    TextBox2.SetFocus
    Exit Sub
End If
If Not IsNumeric(TextBox5.Text) Then
    MsgBox "Tutarı yanlış girdiniz." & vbLf & "Lütfen sayısal bir değer giriniz.", vbCritical, "UYARI"
    TextBox5.SetFocus
    Exit Sub
End If
sat = Sheets(ComboBox1.Value).Cells(65536, "B").End(xlUp).Row + 1
If sat >= 65533 Then
    MsgBox ComboBox1.Value & " İsimli sayfada satır doldu" & vbLf & "Kayıt Girilmedi", vbCritical, "SATIR DOLDU"
    Exit Sub
End If
no = WorksheetFunction.Max(Sheets(ComboBox1.Value).Range("A2:A65536")) + 1
Sheets(ComboBox1.Value).Cells(sat, "A").Value = no
Sheets(ComboBox1.Value).Cells(sat, "B").Value = TextBox1.Text
Sheets(ComboBox1.Value).Cells(sat, "C").Value = CDate(TextBox2.Text)
Sheets(ComboBox1.Value).Cells(sat, "C").NumberFormat = "dd.mm.yyyy"
Sheets(ComboBox1.Value).Cells(sat, "D").Value = TextBox3.Text
Sheets(ComboBox1.Value).Cells(sat, "E").Value = TextBox4.Text
Sheets(ComboBox1.Value).Cells(sat, "F").Value = CDbl(TextBox5.Text)
Sheets(ComboBox1.Value).Cells(sat, "F").NumberFormat = "#,##0.00"
TextBox5.Text = 0
TextBox4.Text = ""
TextBox3.Text = ""
TextBox6.Text = Format(WorksheetFunction.Sum(Sheets(ComboBox1.Value).Range("F2:F65536")), "#,##0.00")
TextBox1.Text = "S" & ComboBox1.ListIndex + 1 & "-" & no + 1
MsgBox "Kayıt başarı ile Girildi." & vbLf & _
"evrengizlen@hotmail.com", vbOKOnly + vbInformation, "E V R E N"
TextBox3.SetFocus
End Sub

Private Sub Image2_Click()


End Sub

Private Sub Image2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Image2.Visible = False
Image1.Visible = True
End Sub

Private Sub Label5_Click()

End Sub

Private Sub UserForm_Initialize()
ComboBox1.AddItem "YAKIT"
ComboBox1.AddItem "GİDERLER"
ComboBox1.AddItem "SU"
ComboBox1.AddItem "ELEKTRİK"
ComboBox1.ListIndex = 0
TextBox2.Text = Format(Date, "dd.mm.yyyy")
TextBox3.SetFocus
End Sub

Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Image2.Visible = True
Image1.Visible = False
End Sub
 

Ekli dosyalar

Üst