Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1824to1828
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

ListBox - nichts ausgewählt.

ListBox - nichts ausgewählt.
15.04.2021 12:16:10
David
Hallo zusammen,
seit längeren nutze ich in meiner ListBox eine mehrfachauswahl die automatisch in spalten geschrieben wird.
Jetzt möchte ich aber das wenn nichts ausgewählt wurde das Tabellenblatt "Softwaremodule" ausgeblendet wird.
Leider bekomme ich das nicht hin... anbei der Code.
   'Softwaremodule aus ListBox in Zelle B36 eintragen
Dim i As Integer
Dim j As Integer
j = 6
For i = 0 To ListBox_Softwaremodule.ListCount - 1
If ListBox_Softwaremodule.Selected(i) Then
ThisWorkbook.Worksheets("Softwaremodule").Cells(j, 2) = ListBox_Softwaremodule.List( _ i, 0)
j = j + 1
Else
ThisWorkbook.Worksheets("Softwaremodule").Visible = False
End If
Next

Danke schon einmal!
Gruß David

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: ListBox - nichts ausgewählt.
15.04.2021 12:29:26
Nepumuk
Hallo David,
teste mal:
    Dim i As Long
Dim j As Long
Dim blnOk As Boolean
j = 6
For i = 0 To ListBox_Softwaremodule.ListCount - 1
If ListBox_Softwaremodule.Selected(i) Then
ThisWorkbook.Worksheets("Softwaremodule").Cells(j, 2) = _
ListBox_Softwaremodule.List(i, 0)
j = j + 1
blnOk = True
End If
Next
If Not blnOk Then ThisWorkbook.Worksheets("Softwaremodule").Visible = xlSheetVeryHidden

Gruß
Nepumuk
AW: ListBox - nichts ausgewählt.
15.04.2021 12:40:27
David
Hallo Nepumuk,
Super dsa hat funktioniert!
Ich Danke dir!
Gruß
Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige