Live-Forum - Die aktuellen Beiträge
Datum
Titel
16.10.2025 17:40:39
16.10.2025 17:25:38
Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender

Forumthread: Menuinhalt rechte Maustaste bei Klick auf Tabellen

Menuinhalt rechte Maustaste bei Klick auf Tabellen
21.10.2005 10:59:39
Rolli
Hallo Forum,
da ich häufig Tabellenblätter aus- bzw. einblenden möchte und mich der Weg über 'Format-Blatt-Ausblenden' stört hab ich mich gefragt, ob es nicht eine Möglichkeit gibt, das Menu der rechten Maustaste so zu erweitern, dass beim Klick auf den Tabellenblattreiter der Punkt "Ausblenden" erscheint.
Alles klar? ((-;
Ein Makro dafür zu schreiben und in einer Symbolleiste zu verankern ist kein Problem, aber nicht gewünscht.
Gruß
Rolli
Anzeige

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Menuinhalt rechte Maustaste bei Klick auf Tabellen
ransi
hallo roli
lass diesen code 1X laufen:
Option Explicit
Public

Sub test()
Application.CommandBars("Ply").Controls.Add ID:=890
End Sub

dann ist "Ausblenden" dauerhaft auf dem tabellenreiter.
ransi
AW: Menuinhalt rechte Maustaste bei Klick auf Tabellen
21.10.2005 12:32:13
Rolli
Hallo ransi,
hat prima funktioniert. Dass das ne normale CommandBar ist hätt ich ja nicht erwartet.
Gibts da irgendwo ne Aufstellung welche CommandBars es gibt und wie sie aussehen.
Gibts auch ne Auflistung, welcher Befehl welche ID hat.
Danke nochmals
Gruß
Rolli
Anzeige
AW: Menuinhalt rechte Maustaste bei Klick auf Tabellen
21.10.2005 12:32:19
Rolli
Hallo ransi,
hat prima funktioniert. Dass das ne normale CommandBar ist hätt ich ja nicht erwartet.
Gibts da irgendwo ne Aufstellung welche CommandBars es gibt und wie sie aussehen.
Gibts auch ne Auflistung, welcher Befehl welche ID hat.
Danke nochmals
Gruß
Rolli
Ist aber etwas länger der code.
ransi


      
Hallo rolli
Hab da vor geraumer zeit mal was gebastelt:
Der code erstellt eine neue symbolleiste 
in der alle Symbolleisten mit ihren controls, deren ID's und deren Icons angezeigt
werden ohne deren funktionalität zu haben.
Das ding dient mir als Nachschlagewerk.
Einfach einmal starten.
Aber:
Gebot nummer1 beim experimentieren mit commandbars:
Erst eine Sicherungskopie der Excel*.XLB machen.
Public 
Sub Zeig_Alles()
    
Dim reset As CommandBarControl
    
Dim cb As CommandBar
    
Dim c As CommandBar
    
Dim a As CommandBar 'Zähler
    Dim b As CommandBarControl
    
Dim cneu As CommandBarControl 'neu
    Dim d As CommandBarControl 'Zähler
    Dim e As CommandBarControl 'neu
    Dim f As CommandBarControl 'Zähler
    Dim g As CommandBarControl 'neu
    Dim h As CommandBarControl 'zähler
    Dim i As CommandBarControl 'neu
    Dim j As CommandBarControl
    
Dim k As CommandBarControl
    
Dim vb As CommandBarControl
   
On Error Resume Next
DoEvents
Application.ScreenUpdating = 
False
For Each cb In Application.CommandBars
    
If cb.Name = "Alle Infos" Then cb.Delete
Next
Set c = Application.CommandBars.Add(Name:="Alle Infos")
Set b = c.Controls.Add(10)
Set vb = c.Controls.Add(10)
Set reset = c.Controls.Add(1)
b.Caption = 
"ID's "
vb.Caption = 
"VBE's"
With reset 'für Neuberechnung
    .Caption = "Reset"
    .Style = msoButtonIconAndCaption
    .FaceId = 940
    .OnAction = 
"Zeig_alles"
End With
c.Visible = 
True
'#############################################################
For Each a In Application.CommandBars
    
If a.Name <> "Alle Infos" Then
        
Set cneu = b.Controls.Add(Type:=msoControlPopup)
        cneu.Caption = a.NameLocal 
' & " ID:=" & a.ID & ", Type:= " & a.Type'ab XP funzt das auch
'##############################################################
        If a.Controls.Count > 0 Then
        
For Each d In a.Controls
            
If Not d Is Nothing Then
                
Set e = cneu.Controls.Add(Type:=IIf(d.Type = 1, 1, 10))
                
With e 'Eigenschaften des Originals abschreiben
                    .Caption = d.Caption & " ID:=" & d.ID & ", Type:= " & d.Type
                    .Style = d.Style
                    .FaceId = d.FaceId
                    .BeginGroup = d.BeginGroup
                
End With
            
End If
'##############################################################
            If d.Controls.Count > 0 Then
            
For Each f In d.Controls
                
If Not f Is Nothing Then
                    
Set g = e.Controls.Add(Type:=IIf(f.Type = 1, 1, 10))
                    
With g 'Eigenschaften des Originals abschreiben
                        .Caption = f.Caption & " ID:=" & f.ID & ", Type:= " & f.Type
                        .Style = f.Style
                        .FaceId = f.FaceId
                        .BeginGroup = f.BeginGroup
                    
End With
                
End If
'###############################################################
                If f.Controls.Count > 0 Then
                
For Each h In f.Controls
                    
If Not h Is Nothing Then
                        
Set i = g.Controls.Add(Type:=IIf(h.Type = 1, 1, 10))
                        
With i 'Eigenschaften des Originals abschreiben
                            .Caption = h.Caption & " ID:=" & h.ID & ", Type:= " & h.Type
                            .Style = h.Style
                            .FaceId = h.FaceId
                            .BeginGroup = h.BeginGroup
                        
End With
                    
End If
'#################################################################
                    For Each j In h.Controls
                    
If Not j Is Nothing Then
                    
Set k = i.Controls.Add(Type:=IIf(j.Type = 1, 1, 10))
                    
With k
                    .Caption = j.Caption & 
" ID:=" & j.ID & ", Type:= " & j.Type
                            .Style = j.Style
                            .FaceId = j.FaceId
                            .BeginGroup = j.BeginGroup
                        
End With
                    
End If
                    
Next
'#################################################################
                Next
             
End If
            
Next
        
End If
        
Next
        
End If
    
End If
Next
Set a = Nothing
Set reset = Nothing
Set cb = Nothing
Set c = Nothing
Set d = Nothing
Set cneu = Nothing
Set e = Nothing
Set f = Nothing
Set g = Nothing
Set h = Nothing
Set i = Nothing
Set j = Nothing
Set k = Nothing
For Each a In Application.VBE.CommandBars
   
If a.Name <> "Alle Infos" Then
        
Set cneu = vb.Controls.Add(Type:=msoControlPopup)
        cneu.Caption = a.NameLocal 
'& " ID:=" & a.ID & ", Type:= " & a.Type
'##############################################################
        If a.Controls.Count > 0 Then
        
For Each d In a.Controls
            
If Not d Is Nothing Then
                
Set e = cneu.Controls.Add(Type:=IIf(d.Type = 1, 1, 10))
                
With e 'Eigenschaften des Originals abschreiben
                    .Caption = d.Caption & " ID:=" & d.ID & ", Type:= " & d.Type
                    .Style = d.Style
                    .FaceId = d.FaceId
                    .BeginGroup = d.BeginGroup
                
End With
            
End If
'##############################################################
            If d.Controls.Count > 0 Then
            
For Each f In d.Controls
                
If Not f Is Nothing Then
                    
Set g = e.Controls.Add(Type:=IIf(f.Type = 1, 1, 10))
                    
With g 'Eigenschaften des Originals abschreiben
                        .Caption = f.Caption & " ID:=" & f.ID & ", Type:= " & f.Type
                        .Style = f.Style
                        .FaceId = f.FaceId
                        .BeginGroup = f.BeginGroup
                    
End With
                
End If
'###############################################################
                If f.Controls.Count > 0 Then
                
For Each h In f.Controls
                    
If Not h Is Nothing Then
                        
Set i = g.Controls.Add(Type:=IIf(h.Type = 1, 1, 10))
                        
With i 'Eigenschaften des Originals abschreiben
                            .Caption = h.Caption & " ID:=" & h.ID & ", Type:= " & h.Type
                            .Style = h.Style
                            .FaceId = h.FaceId
                            .BeginGroup = h.BeginGroup
                        
End With
                    
End If
'#################################################################
                    For Each j In h.Controls
                    
If Not j Is Nothing Then
                    
Set k = i.Controls.Add(Type:=IIf(j.Type = 1, 1, 10))
                    
With k
                    .Caption = j.Caption & 
" ID:=" & j.ID & ", Type:= " & j.Type
                            .Style = j.Style
                            .FaceId = j.FaceId
                            .BeginGroup = j.BeginGroup
                        
End With
                    
End If
                    
Next
'#################################################################
                Next
             
End If
            
Next
        
End If
        
Next
        
End If
   
End If
Next
Application.ScreenUpdating = 
True
Set a = Nothing
Set reset = Nothing
Set cb = Nothing
Set c = Nothing
Set d = Nothing
Set cneu = Nothing
Set e = Nothing
Set f = Nothing
Set g = Nothing
Set h = Nothing
Set i = Nothing
Set j = Nothing
Set k = Nothing
Set vb = Nothing
End Sub
ransi 


Anzeige
;

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Anzeige
Anzeige
Entdecke relevante Threads

Schau dir verwandte Threads basierend auf dem aktuellen Thema an

Alle relevanten Threads mit Inhaltsvorschau entdecken
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige