Thema Datum  Von Nutzer Rating
Antwort
Rot Laufzeitfehler 28/ Probleme beim erstellen eines doppelten Userform Filters
05.05.2022 10:46:12 Thomas
NotSolved
05.05.2022 11:30:48 Gast86304
*
NotSolved
05.05.2022 11:57:50 Thomas
NotSolved
05.05.2022 12:18:14 Gast86304
NotSolved
05.05.2022 12:20:41 Thomas
NotSolved
05.05.2022 12:24:07 Gast86304
NotSolved
05.05.2022 12:26:00 Thomas
NotSolved
05.05.2022 12:44:56 Gast86304
NotSolved
05.05.2022 13:05:02 Thomas
NotSolved
05.05.2022 13:14:51 Gast86304
NotSolved
05.05.2022 12:57:26 ralf_b
NotSolved
06.05.2022 11:21:40 Thomas
NotSolved
06.05.2022 14:36:00 ralf_b
NotSolved
10.05.2022 13:38:48 Thomas
NotSolved
01.06.2022 08:51:35 Thomas
NotSolved
02.06.2022 10:06:37 Thomas
NotSolved
02.06.2022 21:40:34 Gast85948
NotSolved

Ansicht des Beitrags:
Von:
Thomas
Datum:
05.05.2022 10:46:12
Views:
834
Rating: Antwort:
  Ja
Thema:
Laufzeitfehler 28/ Probleme beim erstellen eines doppelten Userform Filters

Hallo,

 

ich habe eine Useform für eine Aktionsliste erstellt, hat grundsätzlich alles gut funktioniert.

die aktionsliste kann gefiltert werden - nach status zu aktionen - offen, in arbeit, pausiert, abgeschlossen.

das filter hat ohne probleme funktioniert, nu ist der wunsch nach einem zweiten filter gekommen - und zwar nach bereichen --> Fertigung, einkauf, usw.

nach was gefiltert wird, wird über userform3 gesteuert.. 

die 4 Status werden über optionbuttons angeklickt(das hat funktioniert) und die Bereiche über eine multiselect-Listbox  (jetzt gehts nichtmehr)

 

unten der ziemlich hässliche Code, zum zweiten Call Eintrag_laden (der befehll befüllt userform 1 mit Daten wenn die filter zutreffen) springt der debugger..

vielleicht kann mir wer helfen

danke, thomas :)

Sub Eintrag_Laden()

    Dim X As Integer
    Dim Y As Integer
    Dim Z As Integer
    Dim presel1 As Integer
    Dim lngPos As Long
    Dim rngItems As Range
    Dim oDictionary As Object


With Worksheets("AIL")

    
    
    
For Z = 0 To UserForm3.ListBox1.ListCount - 1


    If UserForm3.ListBox1.List(Z) = .Cells(i, 3).Value Then
    
    
        If .Cells(i, 10).Value = filter1 Or .Cells(i, 10).Value = filter2 Or .Cells(i, 10).Value = filter3 Or .Cells(i, 10).Value = filter4 Then
        
                    If .Cells(i, 3).Value <> "" Then UserForm1.ComboBox3.Value = .Cells(i, 3).Value
                
                    Set rngItems = Range("C8:C" & lrow1)
                    Set oDictionary = CreateObject("Scripting.Dictionary")
                    
                    With UserForm1.ComboBox3
                        For Each cel In rngItems
                            If oDictionary.exists(cel.Value) Then
                                'Do Nothing
                            Else
                                oDictionary.Add cel.Value, 0
                                .AddItem cel.Value
                            End If
                        Next cel
                    End With
                
                      
                    UserForm1.TextBox6.Value = Worksheets("AIL").Cells(i, 1).Value
                
                    History = 1
                    
                    With Worksheets("Projektteam")
                        UserForm1.ComboBox1.List = .Range(.Cells(2, 1), .Cells(Rows.Count, 1).End(xlUp)).Value
                    End With
                    
                    
                    UserForm1.ComboBox1.ListIndex = -1
                
                    text1 = Cells(i, 6).Value
                
                    textboxin = Format(Now, "dd.mm.yyyy") & " - " & Application.UserName & ": "
                
                    UserForm1.TextBox1.Value = Cells(i, 6).text
                    UserForm1.TextBox5.Value = textboxin
                    
                    text1 = textboxin & Cells(i, 6).Value
                    
                        With UserForm1.TextBox5
                            lngPos = InStr(1, .Value, vbCr) - 1
                            If lngPos > 0 Then
                                .SelStart = lngPos
                            Else
                                .SelStart = .TextLength
                            End If
                         Call .SetFocus
                        End With
                    
                    UserForm1.TextBox3.Value = Cells(i, 5).Value
                    UserForm1.TextBox4.Value = Cells(i, 8).Value
                    
                    
                    date1 = Cells(i, 8).Value
                    
                 
                    UserForm1.TextBox2.Value = Cells(i, 7).Value
                    
                    Prio_A = Worksheets("AIL").Cells(i, 4).Value
                    status_B = Worksheets("AIL").Cells(i, 10).Value
                    
                    
        
       
                    If Cells(i, 4).Value = "A" Then
                    
                        UserForm1.CommandButton10.BackStyle = fmBackStyleOpaque
                        UserForm1.CommandButton11.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton12.BackStyle = fmBackStyleTransparent
                        
                        Prio_B = "A"
                    
                    ElseIf Cells(i, 4).Value = "B" Then
                
                        UserForm1.CommandButton10.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton11.BackStyle = fmBackStyleOpaque
                        UserForm1.CommandButton12.BackStyle = fmBackStyleTransparent
                        
                        Prio_B = "B"
                
                    ElseIf Cells(i, 4).Value = "C" Then
                    
                        UserForm1.CommandButton10.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton11.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton12.BackStyle = fmBackStyleOpaque
                        
                        Prio_B = "B"
                    
                    Else
                    
                        UserForm1.CommandButton10.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton11.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton12.BackStyle = fmBackStyleTransparent
                        
                        Prio_B = ""
                        
                        
                    End If
    

    
                    If Cells(i, 10).Value = "open" Then
                
                        UserForm1.CommandButton1.BackStyle = fmBackStyleOpaque
                        UserForm1.CommandButton2.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton3.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton4.BackStyle = fmBackStyleTransparent
                            
                        status_B = "open"
                        
                    ElseIf Cells(i, 10).Value = "in work" Then
                
                        UserForm1.CommandButton1.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton2.BackStyle = fmBackStyleOpaque
                        UserForm1.CommandButton3.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton4.BackStyle = fmBackStyleTransparent
                        
                        status_B = "in work"
                    
                    ElseIf Cells(i, 10).Value = "on hold" Then
                    
                        UserForm1.CommandButton1.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton2.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton3.BackStyle = fmBackStyleOpaque
                        UserForm1.CommandButton4.BackStyle = fmBackStyleTransparent
                        
                        status_B = "on hold"
                
                    ElseIf Cells(i, 10).Value = "closed" Then
                    
                        UserForm1.CommandButton1.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton2.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton3.BackStyle = fmBackStyleTransparent
                        UserForm1.CommandButton4.BackStyle = fmBackStyleOpaque
                        
                        status_B = "closed"
                    
    
                    ElseIf neuerEintrag = 1 Then
            
                
                            UserForm1.CommandButton1.BackStyle = fmBackStyleOpaque
                            UserForm1.CommandButton2.BackStyle = fmBackStyleTransparent
                            UserForm1.CommandButton3.BackStyle = fmBackStyleTransparent
                            UserForm1.CommandButton4.BackStyle = fmBackStyleTransparent
                                
                            status_B = "open"
                    
                    
                    Else
                    
                            UserForm1.CommandButton1.BackStyle = fmBackStyleTransparent
                            UserForm1.CommandButton2.BackStyle = fmBackStyleTransparent
                            UserForm1.CommandButton3.BackStyle = fmBackStyleTransparent
                            UserForm1.CommandButton4.BackStyle = fmBackStyleTransparent
                                
                            status_B = ""
                        
                    End If
                        
                                                                 
            Else
    
                i = i + 1
                Call Eintrag_Laden
                    
            End If
       
    Else

    i = i + 1
    Call Eintrag_Laden
    
    End If
    
Next Z
    
End With


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 Laufzeitfehler 28/ Probleme beim erstellen eines doppelten Userform Filters
05.05.2022 10:46:12 Thomas
NotSolved
05.05.2022 11:30:48 Gast86304
*
NotSolved
05.05.2022 11:57:50 Thomas
NotSolved
05.05.2022 12:18:14 Gast86304
NotSolved
05.05.2022 12:20:41 Thomas
NotSolved
05.05.2022 12:24:07 Gast86304
NotSolved
05.05.2022 12:26:00 Thomas
NotSolved
05.05.2022 12:44:56 Gast86304
NotSolved
05.05.2022 13:05:02 Thomas
NotSolved
05.05.2022 13:14:51 Gast86304
NotSolved
05.05.2022 12:57:26 ralf_b
NotSolved
06.05.2022 11:21:40 Thomas
NotSolved
06.05.2022 14:36:00 ralf_b
NotSolved
10.05.2022 13:38:48 Thomas
NotSolved
01.06.2022 08:51:35 Thomas
NotSolved
02.06.2022 10:06:37 Thomas
NotSolved
02.06.2022 21:40:34 Gast85948
NotSolved