Thema Datum  Von Nutzer Rating
Antwort
Rot Listbox ohne Nachkommastellen
21.08.2023 08:59:49 Daniel
NotSolved
21.08.2023 09:25:21 Flatulenz
NotSolved
21.08.2023 11:12:43 Gast21033
NotSolved
21.08.2023 11:44:16 Flatulenz
NotSolved
21.08.2023 12:11:06 Gast19061
NotSolved
21.08.2023 12:22:25 Flatulenz
NotSolved
21.08.2023 13:08:50 Gast51383
NotSolved
21.08.2023 13:19:57 Flatulenz
NotSolved
21.08.2023 13:39:00 Gast42632
NotSolved
21.08.2023 13:45:55 Flatulenz
NotSolved
21.08.2023 14:02:25 Gast84991
NotSolved
22.08.2023 14:35:09 Gast6854
NotSolved

Ansicht des Beitrags:
Von:
Daniel
Datum:
21.08.2023 08:59:49
Views:
916
Rating: Antwort:
  Ja
Thema:
Listbox ohne Nachkommastellen

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


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 Listbox ohne Nachkommastellen
21.08.2023 08:59:49 Daniel
NotSolved
21.08.2023 09:25:21 Flatulenz
NotSolved
21.08.2023 11:12:43 Gast21033
NotSolved
21.08.2023 11:44:16 Flatulenz
NotSolved
21.08.2023 12:11:06 Gast19061
NotSolved
21.08.2023 12:22:25 Flatulenz
NotSolved
21.08.2023 13:08:50 Gast51383
NotSolved
21.08.2023 13:19:57 Flatulenz
NotSolved
21.08.2023 13:39:00 Gast42632
NotSolved
21.08.2023 13:45:55 Flatulenz
NotSolved
21.08.2023 14:02:25 Gast84991
NotSolved
22.08.2023 14:35:09 Gast6854
NotSolved