Thema Datum  Von Nutzer Rating
Antwort
09.11.2021 10:32:52 Phaona
Solved
09.11.2021 18:24:26 ralf_b
NotSolved
Rot Dropdown Multiselect
10.11.2021 11:04:15 Phaona
NotSolved
10.11.2021 18:50:02 ralf_b
NotSolved
09.11.2021 20:55:57 xlKing
NotSolved
10.11.2021 11:15:32 Gast37135
NotSolved

Ansicht des Beitrags:
Von:
Phaona
Datum:
10.11.2021 11:04:15
Views:
273
Rating: Antwort:
  Ja
Thema:
Dropdown Multiselect

Hallo, ah, dieses Symbol hab ich übersehen, my bad!

Hier nochmal der Code, schon mit den Änderungen von xlKing:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
'Dropdown mit Mehrfachauswahl & Remove if Double
 
Private Sub Worksheet_Change(ByVal Target As Range)
 
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
Dim lUsed As Long
If Target.Count > 1 Then GoTo exitHandler
If IsNumeric(Target) Then GoTo exitHandler
If IsDate(Target) Then GoTo exitHandler
If Target.HasFormula Then GoTo exitHandler
 
On Error GoTo exitHandler
 
If Target.Validation.Type <> 3 Then GoTo exitHandler
 
'x = (Target.Validation)
   
 
On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeConstants)
On Error GoTo exitHandler
 
If rngDV Is Nothing Then GoTo exitHandler
 
 If Not Intersect(Target, Me.Range("Verein")) Is Nothing Then Exit Sub
 
 
  Application.EnableEvents = False
  newVal = Target.Value
  Application.Undo
  oldVal = Target.Value
  Target.Value = newVal
   
If Target.Column >= 2 Then   '>=3 weil ab Spalte C
 
 If InStr(1, Target.Validation.Formula1, "=Liste") > 0 Then
  
 
    If oldVal = "" Then
      'do nothing
      Else
      If newVal = "" Then
      'do nothing
      Else
        lUsed = InStr(1, oldVal, newVal)
        If lUsed > 0 Then
            If Right(oldVal, Len(newVal)) = newVal Then
                Target.Value = Left(oldVal, Len(oldVal) - Len(newVal) - 2)
            Else
                Target.Value = Replace(oldVal, newVal & ", ", "")
            End If
        Else
            Target.Value = oldVal & ", " & newVal
        End If
      
         
      End If
    End If
  End If
End If
 
exitHandler:
  Application.EnableEvents = True
 
End Sub
 
 
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)   'open dropdown
 
Dim WshShell As Object
Set WshShell = CreateObject("WScript.Shell")
 
    If (Target.Column > 8) Then
        Call floating_buttons
    Else
 
 
    On Error GoTo Err1:
'If Target.Cells.Count = 1 Then
 
        If Target.Validation.InCellDropdown = True Then
        WshShell.SendKeys ("%{DOWN}")
 
        End If
'End If
    WshShell.SendKeys "%{down}" ', True
    'DoEvents
    'SendKeys "{SCROLLLOCK}"
 
Err1:
    'do nothing
     
End If
     
End Sub
 
 
 
'Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
 
Private Sub floating_buttons()
         
        'On Error GoTo 0
         
         
                With Cells(Windows(1).ScrollRow, Windows(1).ScrollColumn)
            CommandButton7.Top = .Top + 15
            CommandButton7.Left = .Left + 1270
        End With
 
                With Cells(Windows(1).ScrollRow, Windows(1).ScrollColumn)
            CommandButton8.Top = .Top + 80
            CommandButton8.Left = .Left + 1270
        End With
 
                With Cells(Windows(1).ScrollRow, Windows(1).ScrollColumn)
            CommandButton9.Top = .Top + 145
            CommandButton9.Left = .Left + 1270
        End With
 
                With Cells(Windows(1).ScrollRow, Windows(1).ScrollColumn)
            CommandButton10.Top = .Top + 210
            CommandButton10.Left = .Left + 1270
        End With
 
                With Cells(Windows(1).ScrollRow, Windows(1).ScrollColumn)
            CommandButton11.Top = .Top + 275
            CommandButton11.Left = .Left + 1270
        End With
 
                With Cells(Windows(1).ScrollRow, Windows(1).ScrollColumn)
            CommandButton12.Top = .Top + 340
            CommandButton12.Left = .Left + 1270
        End With
 
                With Cells(Windows(1).ScrollRow, Windows(1).ScrollColumn)
            CommandButton13.Top = .Top + 405
            CommandButton13.Left = .Left + 1270
        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
09.11.2021 10:32:52 Phaona
Solved
09.11.2021 18:24:26 ralf_b
NotSolved
Rot Dropdown Multiselect
10.11.2021 11:04:15 Phaona
NotSolved
10.11.2021 18:50:02 ralf_b
NotSolved
09.11.2021 20:55:57 xlKing
NotSolved
10.11.2021 11:15:32 Gast37135
NotSolved