Thema Datum  Von Nutzer Rating
Antwort
08.07.2021 07:36:50 SmileStyle
NotSolved
08.07.2021 09:20:09 Gast79811
NotSolved
08.07.2021 09:21:30 SmileStyle
NotSolved
08.07.2021 09:23:58 Gast66185
NotSolved
08.07.2021 09:32:12 SmileStyle
NotSolved
08.07.2021 09:40:23 Gast57885
NotSolved
08.07.2021 09:42:27 Gast27964
NotSolved
08.07.2021 09:45:59 Gast53676
NotSolved
08.07.2021 09:52:01 Gast76879
NotSolved
08.07.2021 11:33:40 Gast4572
NotSolved
08.07.2021 11:48:05 Gast4572
NotSolved
08.07.2021 12:29:56 SmileStyle
NotSolved
08.07.2021 12:45:47 Gast4572
NotSolved
08.07.2021 12:51:09 Mase
NotSolved
08.07.2021 14:50:00 SmileStyle
NotSolved
Blau Kontextmenü Hilfe
12.07.2021 08:06:36 Gast60839
NotSolved
12.07.2021 13:05:39 Gast67685
NotSolved
12.07.2021 13:51:01 SmileStyle
NotSolved
12.07.2021 17:01:12 Gast31774
NotSolved
13.07.2021 09:49:11 SmileStyle
NotSolved
13.07.2021 12:09:49 Gast31774
NotSolved
13.07.2021 12:14:26 Gast24006
NotSolved
13.07.2021 12:25:41 Gast31774
NotSolved
13.07.2021 12:40:32 Gast80767
NotSolved
13.07.2021 13:08:25 Gast38241
NotSolved
13.07.2021 14:17:30 Gast47257
NotSolved
13.07.2021 14:24:39 SmileStyle
NotSolved
13.07.2021 19:38:48 Gast10209
NotSolved
16.07.2021 06:18:11 SmileStyle
NotSolved
18.07.2021 19:21:12 Gast50788
NotSolved
19.07.2021 08:16:44 SmileStyle
NotSolved
19.07.2021 22:11:38 Gast36161
NotSolved
20.07.2021 08:42:14 SmileStyle
NotSolved
20.07.2021 22:34:34 Gast62425
NotSolved
21.07.2021 06:42:03 SmileStyle
NotSolved

Ansicht des Beitrags:
Von:
Gast60839
Datum:
12.07.2021 08:06:36
Views:
987
Rating: Antwort:
  Ja
Thema:
Kontextmenü Hilfe

Guten Morgen,

jetzt muss ich doch nochmal nachfragen wie ich das Ganze mit dem Case-Befehl bei mir aufbauen kann, da ich doch noch andere Fälle in meinem Kontextmenü habe wo ich zum Beispiel löschen muss oder ein Kommentar einfügen will.

habe folgenden Code:

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
Public Sub CreateCommandBar()
 
  Dim objCommandBar As CommandBar
  Dim objCommandBarButton As CommandBarButton
  Dim objName As Name
  Dim lngIndex As Long
 
  Call DeleteCommandBar
 
  Set objCommandBar = CommandBars.Add(Name:=CONTEXT_MENU, _
  Position:=msoBarPopup, Temporary:=True)
 
  For lngIndex = 1 To 25
 
      For Each objName In ThisWorkbook.Names
 
          If objName.Name = "AbwK" & CStr(lngIndex) Then Exit For
 
      Next
 
      If Not objName Is Nothing Then
 
         If Not IsError(Evaluate(objName.RefersTo)) Then
 
            If Not IsEmpty(Range(objName.Name).Value) Then
 
               Set objCommandBarButton = objCommandBar.Controls.Add(Type:=msoControlButton)
 
               With objCommandBarButton
 
                   .Caption = Range(objName.Name).Value
                   .OnAction = "'Färbe """ & Replace$(objName.Name, "K", "Kk") & """'"
 
               End With
            End If
         End If
      End If
  Next
 
  Set objCommandBarButton = Nothing
  Set objCommandBar = Nothing
  Set objName = Nothing
 
End Sub

Der funktioniert soweit auch für den Fall wenn nur die Felder von AbwKk1- 25 dort eingefügt werden sollen. Kann aber jetzt natürlich keine Anweisung geben das er zum Beispiel bei AbwKk1 löschen soll.

Hoffe mir kann geholfen werden.

MfG SmileStyle


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
08.07.2021 07:36:50 SmileStyle
NotSolved
08.07.2021 09:20:09 Gast79811
NotSolved
08.07.2021 09:21:30 SmileStyle
NotSolved
08.07.2021 09:23:58 Gast66185
NotSolved
08.07.2021 09:32:12 SmileStyle
NotSolved
08.07.2021 09:40:23 Gast57885
NotSolved
08.07.2021 09:42:27 Gast27964
NotSolved
08.07.2021 09:45:59 Gast53676
NotSolved
08.07.2021 09:52:01 Gast76879
NotSolved
08.07.2021 11:33:40 Gast4572
NotSolved
08.07.2021 11:48:05 Gast4572
NotSolved
08.07.2021 12:29:56 SmileStyle
NotSolved
08.07.2021 12:45:47 Gast4572
NotSolved
08.07.2021 12:51:09 Mase
NotSolved
08.07.2021 14:50:00 SmileStyle
NotSolved
Blau Kontextmenü Hilfe
12.07.2021 08:06:36 Gast60839
NotSolved
12.07.2021 13:05:39 Gast67685
NotSolved
12.07.2021 13:51:01 SmileStyle
NotSolved
12.07.2021 17:01:12 Gast31774
NotSolved
13.07.2021 09:49:11 SmileStyle
NotSolved
13.07.2021 12:09:49 Gast31774
NotSolved
13.07.2021 12:14:26 Gast24006
NotSolved
13.07.2021 12:25:41 Gast31774
NotSolved
13.07.2021 12:40:32 Gast80767
NotSolved
13.07.2021 13:08:25 Gast38241
NotSolved
13.07.2021 14:17:30 Gast47257
NotSolved
13.07.2021 14:24:39 SmileStyle
NotSolved
13.07.2021 19:38:48 Gast10209
NotSolved
16.07.2021 06:18:11 SmileStyle
NotSolved
18.07.2021 19:21:12 Gast50788
NotSolved
19.07.2021 08:16:44 SmileStyle
NotSolved
19.07.2021 22:11:38 Gast36161
NotSolved
20.07.2021 08:42:14 SmileStyle
NotSolved
20.07.2021 22:34:34 Gast62425
NotSolved
21.07.2021 06:42:03 SmileStyle
NotSolved