Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
396to400
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
396to400
396to400
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Code verbessern für schnellere Ausgabe an Userform

Code verbessern für schnellere Ausgabe an Userform
16.03.2004 15:20:23
Josef Bouchi
Hallo,
ich habe folgenden Code gebastelt, um ganz bestimmte Werte aus einer Tabelle in eine Userform auszulesen. Der Code ist mittlerweile sogar was länger geworden, aber im Prinzip ähnelt er diesem. Mein "Problem": es dauert einige Sekunden bis diese ausgelesen werden. Nicht wirklich gravierend, aber ich denke das geht auch schneller. Für jeden Ansatz bin ich dankbar. Hier der Code.

Private Sub UserForm_Initialize()
'Aktuelle Werte aus Tabelle übernehmen
Dim iRow As Integer
Cells([a65536].End(xlUp).Row, 1).Activate
Me.labelNr = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.txt_PolicyCheck = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.txtDatumIn = ActiveCell
ActiveCell.Offset(columnOffset:=3).Activate
Me.ComboBox1 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.ComboBox2 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.ComboBox3 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.ComboBox4 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox1 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox2 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox16 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox3 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox6 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox4 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox14 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox12 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox5 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox7 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox13 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox17 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox18 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox19 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
If ActiveCell.Value = "Yes" Then
Me.opt_Yes = ActiveCell
Else:
Me.opt_No = ActiveCell
End If
ActiveCell.Offset(columnOffset:=1).Activate
If ActiveCell.Value = "Justified" Then
Me.opt_justified = ActiveCell
ElseIf ActiveCell.Value = "not justified" Then
Me.opt_notjustified = ActiveCell
Else:
Me.opt_partly = ActiveCell
End If
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox8 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox9 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox10 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.CheckBox11 = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.handled_by = ActiveCell
ActiveCell.Offset(columnOffset:=1).Activate
Me.registered_by = ActiveCell
End Sub

Danke schön.
Grüsse
Josef

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Code verbessern für schnellere Ausgabe an Userform
16.03.2004 15:23:40
Hajo_Zi
Hallo Josef
du beschwerst Dich über paar Sekunden die Dein Programm braucht, wir sollen aber paar Minuten investieren um Deine Userform nachzubauen.

Bitte keine Mail, Probleme sollten im Forum gelöst werden.
Microsoft MVP für Excel
Das Forum lebt auch von den Rückmeldungen.
Betriebssystem XP Pro und Excel Version XP Pro


AW: Code verbessern für schnellere Ausgabe an Userform
16.03.2004 16:57:49
Josef Bouchi
Hallo,
sorry hast recht. Ich werde mal alles reinstellen, wenn ich so weit bin. Dann macht es wohl mehr Sinn.
Grüsse
Josef
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige