Sub listbox_ohne_leere()
Dim wsTabelle As Worksheet
Dim loLetzte As Long, loZeile As Long
Set wsTabelle = Worksheets("Tabelle2")
loLetzte = 7
With UserForm1.ListBox1
For loZeile = 1 To loLetzte
' Übergabe des Wertes, wenn er verschieden vom vorhergehenden und ungleich leer ist
If CStr(wsTabelle.Cells(loZeile, 1)) <> "" And CStr(wsTabelle.Cells(loZeile, 3)) <> "" And CStr(wsTabelle.Cells(loZeile, 3)) <> "" Then
.AddItem wsTabelle.Cells(loZeile, 1)
.List(.ListCount - 1, 1) = wsTabelle.Cells(loZeile, 2)
.List(.ListCount - 1, 2) = wsTabelle.Cells(loZeile, 3)
End If
Next loZeile
End With
End Sub
Sub Liste_fuellen()
For n = 1 To 100
ListBox1.AddItem ActiveSheet.Range("A" & n)
Next n
End Sub
[b]frmDE[/b].Listbox1..... vorstellen. Kann man diesen Wert in irgend einer Art und Weise an die Funktion übergeben, dass diese dann je nach UserForm arbeitet?Option Explicit
Public inUserForm As Integer
Public frmUserForm As UserForm
Sub ausgelagert()
Dim n As Integer
Select Case inUserForm
Case 1
Set frmUserForm = UF1
Case 2
Set frmUserForm = UF2
End Select
With frmUserForm
For n = 1 To 100
.ListBox1.AddItem ActiveSheet.Range("A" & n)
Next n
End With
End Sub
Probleme mit Excel2003 VBA Daten in Excel2007
hagajaka 24.04.2007 - 127 Hits -
Excel hat 65.536 Zeilen
Rolando 27.11.2007 - 173 Hits - 2 Antworten
Daten aus einer Abfrage in Access in eine vorgefertigte Excel-Tabelle exportieren
Tara10 05.03.2008 - 153 Hits - 5 Antworten
VBA Excel in unterste Zelle springen
Winniki 12.05.2008 - 75 Hits - 1 Antwort
VBA-Excel
mentosbasi 28.05.2008 - 350 Hits - 3 Antworten