ComboBox mit Variabler aus Makro verknüpfen
Hallo Forum,
Ich stocke momentan an einer Aufgabe:
Ich habe eine Combobox (Bild unten angehängt), welche mit den Items 0, 20, 40, 60, 80, 100 gefüllt ist.
Diese Werte sollen mit Ok bestätigt werden (Diesen Button habe ich noch nicht konfiguriert - weiß leider auch nicht wie man diese Bestätigung schreibt)
Nun sollen diese Werte einer Variablen zugeschrieben werden: z.B. Eingabe von ComboBox nach Bestätigung ist dann z.B. p
Dieses p soll dann in einem Makro hier eingreifen:
Also soll hier dann theoretisch stehen:
Leider liegt das Makro in Modul2 und der Code für die ComboBox in dem Fenster (UserForm).
Desweiteren ist die ComboBox in dem 3. Fenster der Multiseiten.
Kann wer helfen?
Mit freundlichen Grüßen Stefan
Ich stocke momentan an einer Aufgabe:
Ich habe eine Combobox (Bild unten angehängt), welche mit den Items 0, 20, 40, 60, 80, 100 gefüllt ist.
With Me.ComboBox27
.AddItem "0"
.AddItem "20"
.AddItem "40"
.AddItem "60"
.AddItem "80"
.AddItem "100"
End With
Diese Werte sollen mit Ok bestätigt werden (Diesen Button habe ich noch nicht konfiguriert - weiß leider auch nicht wie man diese Bestätigung schreibt)
Nun sollen diese Werte einer Variablen zugeschrieben werden: z.B. Eingabe von ComboBox nach Bestätigung ist dann z.B. p
Dieses p soll dann in einem Makro hier eingreifen:
Cells(3, x) = 100
Also soll hier dann theoretisch stehen:
Cells(3, x) = p
Leider liegt das Makro in Modul2 und der Code für die ComboBox in dem Fenster (UserForm).
Desweiteren ist die ComboBox in dem 3. Fenster der Multiseiten.
Kann wer helfen?
Mit freundlichen Grüßen Stefan

Bitte markiere auch die Kommentare, die zur Lösung des Beitrags beigetragen haben
Content-ID: 312363
Url: https://administrator.de/forum/combobox-mit-variabler-aus-makro-verknuepfen-312363.html
Ausgedruckt am: 11.03.2025 um 07:03 Uhr
5 Kommentare
Neuester Kommentar

Define a public variable in your sheet or module and assign it the value or directly assign the value of the combobox:
Or create a public Function with a parameter and call it with your data as parameter value.
Regards
p.s. why don't you answer in your other questions ??
Cells(3, x).Value = Me.Combobox27.Value
Regards
p.s. why don't you answer in your other questions ??

Zitat von @Anrion:
When i type this code instead of the Cells(3, x) = 100 then the debugger tells me that the Me is not correct
Where do you write ? In the code of the form or anywhere else? The above works only on the form itself.When i type this code instead of the Cells(3, x) = 100 then the debugger tells me that the Me is not correct
Do I Have to type sth. after the AddItems ?
Don't know what you mean, sorry.And can you tell me how to confirm the Load of the Ok button? When I press it it doenst close.. only know that it close when unload Me but its the close button not the ok button.
What do you want to confirm? A msgbox should apear after you click on the OK Button ? Then in the click eventhandler of the button writeif msgbox("Do you want to commit the settings?",(vbQuestion or vbYesNo)) = vbYes then
me.hide
End if

I wrote
Then in the click eventhandler of the button
so double click on the button, then the code window with the eventhandler will pop up...