Thema Datum  Von Nutzer Rating
Antwort
02.06.2016 11:14:41 David
Solved
02.06.2016 14:09:06 Gast22981
NotSolved
02.06.2016 14:28:08 David
NotSolved
02.06.2016 14:54:25 Gast49737
NotSolved
02.06.2016 15:20:03 David
NotSolved
02.06.2016 16:09:27 Gast18220
NotSolved
02.06.2016 16:30:55 David
NotSolved
02.06.2016 18:48:44 Gast70202
NotSolved
02.06.2016 19:02:30 David
NotSolved
02.06.2016 19:43:31 Gast83713
NotSolved
02.06.2016 19:52:34 David
NotSolved
02.06.2016 20:02:48 David
NotSolved
02.06.2016 20:03:22 Gast24976
NotSolved
02.06.2016 20:02:51 Gast83147
NotSolved
02.06.2016 20:23:31 David
NotSolved
02.06.2016 21:26:15 Gast86243
NotSolved
02.06.2016 22:25:52 David
NotSolved
02.06.2016 22:31:07 David
NotSolved
03.06.2016 09:54:26 Gast50518
NotSolved
03.06.2016 10:36:01 David
NotSolved
03.06.2016 18:04:44 David
NotSolved
03.06.2016 19:35:45 Gast52557
NotSolved
03.06.2016 22:09:28 Gast87028
NotSolved
Blau Dropdown-Auswahlliste Makro / Formel?
03.06.2016 22:31:51 Gast22731
NotSolved
03.06.2016 22:43:32 Gast72656
NotSolved
04.06.2016 09:02:30 Gast97636
NotSolved
04.06.2016 13:10:06 Gast88175
NotSolved
02.06.2016 19:03:29 David
NotSolved

Ansicht des Beitrags:
Von:
Gast22731
Datum:
03.06.2016 22:31:51
Views:
474
Rating: Antwort:
  Ja
Thema:
Dropdown-Auswahlliste Makro / Formel?

Guten Abend! Auf die schnelle und ohne Kommentare :-) der Code unten. In das Blatt 2 kopieren, dort soll A und B passieren oder !? Das ganze läuft dann als Ereignis. Du kannst also zwischendrin den Buchstaben ändern und der andere Beriech wird genutzt. Wenn ein andere Buchstabe genutzt wird, ändert sich an der Einstellung nix (es bleibt die alte Gütligkeit). VG und schönes Wochenende

 

Private Sub Worksheet_Change(ByVal Target As Range)

If Replace(Target.Address, "$", "") = "G3" Then
Dim gültigliste As String
Dim i As Long
Dim letzte As Long
Dim spalte As Long

If Target = "A" Then
    spalte = 1
ElseIf Target = "B" Then
    spalte = 5
Else
    End
End If
     
With Sheets("Analysedaten")
gültigliste = ","

letzte = .Cells(Rows.Count, spalte).End(xlUp).Row
    
For i = 2 To letzte
    If .Cells(i, spalte) <> "" And IsNumeric(.Cells(i, spalte)) Then
        If InStr(1, gültigliste, "," & .Cells(i, spalte) & ",", vbTextCompare) = 0 Then gültigliste = gültigliste & CLng(.Cells(i, spalte)) & ","
    End If
Next i
   
End With
  
If gültigliste <> "," Then
      
    gültigliste = Mid(gültigliste, 2, Len(gültigliste) - 2)
       
    gültigliste = BubbleSort(gültigliste)
    With Sheets("Tabelle2").Range("G5").Validation
        .Delete
        .Add Type:=xlValidateList, Formula1:=gültigliste
    End With
        
End If

End If
End Sub

Function BubbleSort(a As Variant)
    Dim i As Long, n As Long, Temp As Long
    Dim sortiert As Boolean
    Dim test
    test = Split(a, ",")
    n = UBound(test)
    Do
        sortiert = True
        For i = 0 To n - 1
            If CLng(test(i)) > CLng(test(i + 1)) Then
                Temp = CLng(test(i))
                test(i) = CLng(test(i + 1))
                test(i + 1) = Temp
                sortiert = False
            End If
        Next i
    Loop Until sortiert
      
    ergebnis = Join(test, ",")
    BubbleSort = ergebnis
End Function

 


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
02.06.2016 11:14:41 David
Solved
02.06.2016 14:09:06 Gast22981
NotSolved
02.06.2016 14:28:08 David
NotSolved
02.06.2016 14:54:25 Gast49737
NotSolved
02.06.2016 15:20:03 David
NotSolved
02.06.2016 16:09:27 Gast18220
NotSolved
02.06.2016 16:30:55 David
NotSolved
02.06.2016 18:48:44 Gast70202
NotSolved
02.06.2016 19:02:30 David
NotSolved
02.06.2016 19:43:31 Gast83713
NotSolved
02.06.2016 19:52:34 David
NotSolved
02.06.2016 20:02:48 David
NotSolved
02.06.2016 20:03:22 Gast24976
NotSolved
02.06.2016 20:02:51 Gast83147
NotSolved
02.06.2016 20:23:31 David
NotSolved
02.06.2016 21:26:15 Gast86243
NotSolved
02.06.2016 22:25:52 David
NotSolved
02.06.2016 22:31:07 David
NotSolved
03.06.2016 09:54:26 Gast50518
NotSolved
03.06.2016 10:36:01 David
NotSolved
03.06.2016 18:04:44 David
NotSolved
03.06.2016 19:35:45 Gast52557
NotSolved
03.06.2016 22:09:28 Gast87028
NotSolved
Blau Dropdown-Auswahlliste Makro / Formel?
03.06.2016 22:31:51 Gast22731
NotSolved
03.06.2016 22:43:32 Gast72656
NotSolved
04.06.2016 09:02:30 Gast97636
NotSolved
04.06.2016 13:10:06 Gast88175
NotSolved
02.06.2016 19:03:29 David
NotSolved