Thema Datum  Von Nutzer Rating
Antwort
Rot Textbox und ComboBox Addieren
01.11.2015 15:16:34 Ewgenij
NotSolved

Ansicht des Beitrags:
Von:
Ewgenij
Datum:
01.11.2015 15:16:34
Views:
1093
Rating: Antwort:
  Ja
Thema:
Textbox und ComboBox Addieren

Hallo Zusammen

Ich habe folgendes Problem: 
Mein Ziel ist es TextBox3(Geldeingang)durch ComboBox3(Geteilt)zu teilen und in TextBox5(Umsatz)auszugeben.
Also TextBox5 = TextBox4/ComboBox3

Habe viel Experimentiert und habe auch nicht wirklich viel Ahnung von Programmiersprachen. 

>Hier die Excel Datei als Link in Dropbox: !!!!!Das ist die Datei wie es aussehen sollte!!!!!
Link:https://www.dropbox.com/s/lddo9kbbso0ne2n/Eingabemaske1%281%29223.xlsm?dl=0 


Code:

Option Explicit

Private Sub ComboBox1_Click()
If ComboBox1.ListIndex <> 0 Then
    TextBox1 = Cells(ComboBox1.ListIndex + 1, 2)
    TextBox2 = Cells(ComboBox1.ListIndex + 1, 3)
    TextBox3 = Cells(ComboBox1.ListIndex + 1, 4)
    TextBox4 = Cells(ComboBox1.ListIndex + 1, 5)
    TextBox5 = Cells(ComboBox1.ListIndex + 1, 6)
    ComboBox2 = Cells(ComboBox1.ListIndex + 1, 7)
    ComboBox3 = Cells(ComboBox1.ListIndex + 1, 8)
    ComboBox4 = Cells(ComboBox1.ListIndex + 1, 9)
    ComboBox5 = Cells(ComboBox1.ListIndex + 1, 10)
    ComboBox6 = Cells(ComboBox1.ListIndex + 1, 11)
Else
    TextBox1 = ""
    TextBox2 = ""
    TextBox3 = ""
    TextBox4 = ""
    TextBox5 = ""
    ComboBox2 = ""
    ComboBox3 = ""
    ComboBox4 = ""
    ComboBox5 = ""
    ComboBox6 = ""
End If
End Sub

Private Sub CommandButton1_Click()
If ComboBox1.ListIndex > 0 Then
    Rows(ComboBox1.ListIndex + 1).Delete
    TextBox1 = ""
    TextBox2 = ""
    TextBox3 = ""
    TextBox4 = ""
    TextBox5 = ""
    ComboBox2 = ""
    ComboBox3 = ""
    ComboBox4 = ""
    ComboBox5 = ""
    ComboBox6 = ""
    UserForm_Initialize
End If
End Sub

Private Sub CommandButton2_Click()
Dim xZeile As Long
If TextBox1 = "" Then Exit Sub
If ComboBox1.ListIndex = 0 Then
    xZeile = [B65536].End(xlUp).Row + 1
Else
    xZeile = ComboBox1.ListIndex + 1
End If
Cells(xZeile, 2) = TextBox1
Cells(xZeile, 3) = TextBox2
Cells(xZeile, 4) = TextBox3
Cells(xZeile, 5) = TextBox4
Cells(xZeile, 6) = TextBox5
Cells(xZeile, 7) = ComboBox2
Cells(xZeile, 8) = ComboBox3
Cells(xZeile, 9) = ComboBox4
Cells(xZeile, 10) = ComboBox5
Cells(xZeile, 11) = ComboBox6
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
ComboBox2 = ""
ComboBox3 = ""
ComboBox4 = ""
ComboBox5 = ""
ComboBox6 = ""
UserForm_Initialize
End Sub

Private Sub CommandButton3_Click()
Unload Me
End Sub


Private Sub Frame1_Click()

End Sub

Private Sub Frame4_Click()

End Sub

Private Sub ListBox1_Click()

End Sub

Private Sub ListBox3_Click()

End Sub

Private Sub MultiPage1_Change()

End Sub

Private Sub TextBox3_Change()

End Sub

Private Sub UserForm_Initialize()
Dim aRow, i As Variant
Application.EnableEvents = False
ComboBox1.Clear
ComboBox2.Clear
ComboBox3.Clear
ComboBox4.Clear
ComboBox5.Clear
ComboBox6.Clear
aRow = [B65536].End(xlUp).Row
ComboBox1.AddItem "neue Kunde hinzufügen"
With Me.ComboBox2
  .AddItem ""
  .AddItem "12"
  .AddItem "24"
  .AddItem "36"
  .AddItem "48"
  .AddItem "60"
  .ListIndex = "0"
End With
With Me.ComboBox3
  .AddItem ""
  .AddItem "1"
  .AddItem "2"
  .AddItem "3"
  .AddItem "4"
  .AddItem "5"
  .ListIndex = "0"
End With
With Me.ComboBox4
  .AddItem ""
  .AddItem "Ja"
  .AddItem "Nein"
  .ListIndex = "0"
End With
With Me.ComboBox5
  .AddItem ""
  .AddItem "Ja"
  .AddItem "Nein"
  .ListIndex = "0"
End With
With Me.ComboBox6
  .AddItem ""
  .AddItem "Ingo"
  .AddItem "Jemand anderes"
  .ListIndex = "0"
End With
For i = 2 To aRow
    ComboBox1.AddItem Cells(i, 2)
Next i
ComboBox1.ListIndex = 0
ComboBox2.ListIndex = 0
ComboBox3.ListIndex = 0
ComboBox4.ListIndex = 0
ComboBox5.ListIndex = 0
ComboBox6.ListIndex = 0
Application.EnableEvents = True


ListBox1.ColumnCount = 10
Dim arr
arr = Sheets("Tabelle1").Range("B2:K500000")
ListBox1.List = arr
End Sub


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
Rot Textbox und ComboBox Addieren
01.11.2015 15:16:34 Ewgenij
NotSolved