Live-Forum - Die aktuellen Beiträge
Datum
Titel
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
188to192
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
188to192
188to192
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

combobox prob

combobox prob
06.12.2002 18:03:24
leo
hallo zusammen

also ich hab eine eigene menüleiste namens MyCommandbar erstellt. dort gibt es eine combobox namens Dienstpläne wo man alle sichbaren tabellenblätter auswählen kann. jetzt das problem: wenn ich in der combobox das active sheet auswähle kommt ein fehler, wieso??

If Sheets(Application.CommandBars("MyCommandBar") _
.Controls("Dienstpläne").text) = ActiveSheet.Name Then
...

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Re: combobox prob
06.12.2002 18:05:49
MRR
Welcher Code wird ausgeführt, wenn Du ein anderes Blatt wählst?
Matthias
Re: combobox prob
06.12.2002 18:07:29
leo
Public Sub ComboMenueBox()

Dim oBar As CommandBar
Dim oCbo As CommandBarComboBox

Set oBar = Application.CommandBars("MyCommandBar")
On Error Resume Next
oBar.Controls("Dienstpläne").Delete
On Error GoTo 0
With oCbo

Dim i As Integer
Dim wks As Worksheet
Call ComboMenueBox_loeschen
Set oCbo = Application.CommandBars("MyCommandBar") _
.Controls.Add(msoControlComboBox)
With oCbo
.Caption = "Dienstpläne"
.Width = 100
For Each wks In Worksheets
If wks.Name <> "Dienstplan" Then oCbo.AddItem wks.Name
.OnAction = "BlattAuswahl"
Next wks
.text = "Wählen..."
End With

End With

End Sub
_____

Public Sub BlattAuswahl()

On Error GoTo fehler

Sheets(Application.CommandBars("MyCommandBar") _
.Controls("Dienstpläne").text).Select

fehler:
If Sheets(Application.CommandBars("MyCommandBar") _
.Controls("Dienstpläne").text) = ActiveSheet.Name Then
Exit Sub
End If
MsgBox ("Dienstplan nicht auffindbar !")
Call MenuErstellen

End Sub

Anzeige
Re: combobox prob
06.12.2002 22:14:43
M. Kuhn
Moin Leo,

probier mal:

statt: If Sheets(Application.CommandBars("MyCommandBar").Controls("Dienstpläne").text) = ActiveSheet.Name Then

das hier: If Selection.Name = ActiveSheet.Name Then

MfG Mario

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige