Hallo zusammen,
ich bin absoluter anfänger und brauch mal eure Hilfe ich würde gerne in meiner Listbox die Letzte Spalte die mir angezeigt wird zum Beispiel von 9,22222222 in 9 anzeigen lassen also die Kommastellen sollen nicht angezeigt werdem.
könnte mir jemand dazu hilfe Leisten?
Lg
Private Sub CommandButton2_Click()
UserForm.Hide
End Sub
Private Sub CommandButton3_Click()
Dim xlObj As Object
Set xlObj = CreateObject("Excel.Application")
With xlObj
.Visible = True
.Workbooks.Open ("M:\Logistik\00_Organisation\Personalplan\Dashboard_ILO.xlsx")
End With
End Sub
Private Sub ListBox1_Click()
Me.ListBox1.AddItem Format(Cells(1, 7), "0.0")
End Sub
Private Sub TextBox2_Change()
With WorksheetFunction
TextBox1.Text = .Sum(.Index(ListBox1.List, 0, 7))
End With
End Sub
Private Sub UserForm_Initialize()
Dim Zeile As Long
'Schleife über alle Zeilen der Tabelle
For Zeile = 1 To Tabelle3.Cells(Rows.Count, 2).End(xlUp).Row
Me.ListBox1.AddItem Tabelle3.Cells(Zeile, 1)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = Tabelle3.Cells(Zeile, 2)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = Tabelle3.Cells(Zeile, 3)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 3) = Tabelle3.Cells(Zeile, 4)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 4) = Tabelle3.Cells(Zeile, 5)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 5) = Tabelle3.Cells(Zeile, 6)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 6) = Tabelle3.Cells(Zeile, 7)
Me.ListBox1.AddItem Format(Cells(1, 6), "0.0")
'Me.ListBox1.AddItem Format(Cells(1, 6), "0.0")
Next Zeile
'Erstes Element als Default auswählen
Me.ListBox1.Selected(0) = True
End Sub
Private Sub TextBox1_Change()
Dim Zeile As Long
Me.ListBox1.Clear
'Schleife über alle Zeilen der Tabelle
For Zeile = 1 To Tabelle3.Cells(Rows.Count, 2).End(xlUp).Row
If InStr(1, LCase(Tabelle3.Cells(Zeile, 1).Value), LCase(Me.TextBox1.Value)) <> 0 Or _
InStr(1, LCase(Tabelle3.Cells(Zeile, 2).Value), LCase(Me.TextBox1.Value)) <> 0 Or _
InStr(1, LCase(Tabelle3.Cells(Zeile, 3).Value), LCase(Me.TextBox1.Value)) <> 0 Or _
InStr(1, LCase(Tabelle3.Cells(Zeile, 4).Value), LCase(Me.TextBox1.Value)) <> 0 Or _
InStr(1, LCase(Tabelle3.Cells(Zeile, 5).Value), LCase(Me.TextBox1.Value)) <> 0 Or _
InStr(1, LCase(Tabelle3.Cells(Zeile, 6).Value), LCase(Me.TextBox1.Value)) <> 0 Then
Me.ListBox1.AddItem Tabelle3.Cells(Zeile, 1)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = Tabelle3.Cells(Zeile, 2)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = Tabelle3.Cells(Zeile, 3)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 3) = Tabelle3.Cells(Zeile, 4)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 4) = Tabelle3.Cells(Zeile, 5)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 5) = Tabelle3.Cells(Zeile, 6)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 6) = Tabelle3.Cells(Zeile, 7)
End If
Next Zeile
End Sub
|