Live-Forum - Die aktuellen Beiträge
Datum
Titel
24.04.2024 19:29:30
24.04.2024 18:49:56
Anzeige
Archiv - Navigation
1240to1244
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
Userform mittels Variable ansprechen
Captain
Hi @all,
wie kann ich eine Userform ansprechen (und einen Code hierfür ausführen), dessen Name ich in einer Variable habe?
Den Namen hole ich mir mit: aktUF = Me.Name
In dem Modul würde ich jetzt gerne so arbeiten:
Userforms(aktUF).TextBox1.Text= ...
aber das geht so nicht... bekomme eine Fehlermeldung
Habt ihr einen Tip für mich?
Danke
Jack

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

Betreff
Benutzer
Anzeige
AW: Userform mittels Variable ansprechen
29.12.2011 10:39:29
Hajo_Zi
definiere eine Variable als Objekt
Set variable Me
Variable.Textbox1=...

AW: Userform mittels Variable ansprechen
29.12.2011 10:57:51
Captain
Hi Hajo,
echt klasse...funzt natürlich :-)
Danke und Guten Rutsch
Jack
AW: Userform mittels Variable ansprechen
29.12.2011 12:58:09
dan
Hi Jack,
laut Help is es so:
The UserForms collection is a collection whose elements represent each loaded UserForm in an application.
The UserForms collection has a Count property, an Item property, and an Add method. Count specifies the number of elements in the collection; Item (the default member) specifies a specific collection member; and Add places a new UserForm element in the collection.
Syntax
UserForms[.Item](index)
The placeholder index represents an integer with a range from 0 to UserForms.Count – 1. Item is the default member of the UserForms collection and need not be specified.
Remarks
You can use the UserForms collection to iterate through all loaded user forms in an application. It identifies an intrinsic global variable named UserForms. You can pass UserForms(index) to a function whose argument is specified as a UserForm class.
User forms have properties that determine appearance such as position, size, and color; and aspects of their behavior.
User forms can also respond to events initiated by a user or triggered by the system. For example, you can write code in the Initialize event procedure of the UserForm to initialize module-level variables before the UserForm is displayed.
usw...
Mfg dan, cz
Anzeige

301 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige