Thema Datum  Von Nutzer Rating
Antwort
14.01.2017 22:07:14 Matthias
NotSolved
14.01.2017 22:14:24 Crazy Tom
NotSolved
14.01.2017 22:25:45 Gast38058
NotSolved
14.01.2017 22:39:04 Crazy Tom
NotSolved
14.01.2017 22:42:57 Matthias
NotSolved
14.01.2017 22:45:48 Matthias
NotSolved
14.01.2017 22:53:16 Crazy Tom
NotSolved
14.01.2017 23:02:13 Matthias
NotSolved
14.01.2017 23:03:32 Crazy Tom
NotSolved
14.01.2017 23:12:14 Matthias
NotSolved
14.01.2017 23:18:05 Crazy Tom
NotSolved
14.01.2017 23:19:06 Matthias
NotSolved
15.01.2017 11:11:46 Matthias
NotSolved
Blau EIn Kombinationsfeld, mehrere Makros
15.01.2017 08:09:10 Gast2612
NotSolved
15.01.2017 08:13:03 Gast2612
NotSolved
15.01.2017 08:19:51 Crazy Tom
NotSolved
15.01.2017 08:34:58 Gast12349
NotSolved
15.01.2017 08:42:01 Crazy Tom
NotSolved
15.01.2017 10:23:33 Matthias
NotSolved
15.01.2017 11:21:32 Crazy Tom
Solved
15.01.2017 11:31:57 Matthias
NotSolved
15.01.2017 11:22:05 Matthias
Solved

Ansicht des Beitrags:
Von:
Gast2612
Datum:
15.01.2017 08:09:10
Views:
661
Rating: Antwort:
  Ja
Thema:
EIn Kombinationsfeld, mehrere Makros

Erst vor kurzem gab es hier ein ähnliches Anliegen (s. hier) nur mit Schaltfläche.


Das dortige Beispiel auf deines umgemünzt:

'Module
Option Explicit
 
Public Sub OnDropDownChange()
   
  If 0 <> StrComp(TypeName(Application.Caller), "String", vbTextCompare) Then
    Exit Sub
  End If
   
  Dim shp As Excel.Shape
   
  Set shp = ActiveSheet.Shapes(Application.Caller)
  If shp.Type <> MsoShapeType.msoFormControl Then Exit Sub
  If shp.FormControlType <> XlFormControl.xlDropDown Then Exit Sub
   
  Dim rngList As Excel.Range
  
  Set rngList = shp.TopLeftCell.Worksheet.Range(shp.ControlFormat.ListFillRange)
  
  If shp.ControlFormat.ListIndex > 0 Then
'ANHAND der Bezeichnung:
    Select Case rngList.Cells(shp.ControlFormat.ListIndex)
      Case "variable Leasingrate"
        Call var_Leas_1
      Case "konstante Leasingrate"
        Call konst_Leas_1
    End Select
''ODER anhand des Index:
'    Select Case shp.ControlFormat.ListIndex
'      Case 1 '"variable Leasingrate"
''        Call var_Leas_1
'      Case 2 '"konstante Leasingrate"
''        Call konst_Leas_1
'    End Select
  End If
  
End Sub

Sub var_Leas_1()
  MsgBox "variabel"
End Sub

Sub konst_Leas_1()
  MsgBox "konstant"
End Sub

Weise deinem Kombinationsfeld das Makro OnDropDownChange zu (per Rechtsklick). Wenn du jetzt etwas auswählst, wird das besagte Makro ausgeführt.

Grüße


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
14.01.2017 22:07:14 Matthias
NotSolved
14.01.2017 22:14:24 Crazy Tom
NotSolved
14.01.2017 22:25:45 Gast38058
NotSolved
14.01.2017 22:39:04 Crazy Tom
NotSolved
14.01.2017 22:42:57 Matthias
NotSolved
14.01.2017 22:45:48 Matthias
NotSolved
14.01.2017 22:53:16 Crazy Tom
NotSolved
14.01.2017 23:02:13 Matthias
NotSolved
14.01.2017 23:03:32 Crazy Tom
NotSolved
14.01.2017 23:12:14 Matthias
NotSolved
14.01.2017 23:18:05 Crazy Tom
NotSolved
14.01.2017 23:19:06 Matthias
NotSolved
15.01.2017 11:11:46 Matthias
NotSolved
Blau EIn Kombinationsfeld, mehrere Makros
15.01.2017 08:09:10 Gast2612
NotSolved
15.01.2017 08:13:03 Gast2612
NotSolved
15.01.2017 08:19:51 Crazy Tom
NotSolved
15.01.2017 08:34:58 Gast12349
NotSolved
15.01.2017 08:42:01 Crazy Tom
NotSolved
15.01.2017 10:23:33 Matthias
NotSolved
15.01.2017 11:21:32 Crazy Tom
Solved
15.01.2017 11:31:57 Matthias
NotSolved
15.01.2017 11:22:05 Matthias
Solved