Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Anzeige
Inhaltsverzeichnis

textbox

Forumthread: textbox

textbox
10.04.2008 20:28:53
ralf
hallo forum
habe in userform mehrere textboxen die von der tabelle aus gefüllt werden.
gibt es eine möglichkeit die textboxen anders und kürzer zu füllen als so.

Private Sub UserForm_Initialize()
With Me
.TextBox1.Value = Format(CDbl(ActiveSheet.Range("X1")), "#,##0.00")
If TextBox1.Value = 0 Then
.TextBox1.Value = Format(CDbl(.TextBox1.Text), "#,##0.00")
End If
.TextBox2.Value = Format(CDbl(ActiveSheet.Range("X2")), "#,##0.00")
If TextBox1.Value = 0 Then
.TextBox2.Value = Format(CDbl(.TextBox2.Text), "#,##0.00")
End If
.TextBox3.Value = Format(CDbl(ActiveSheet.Range("X3")), "#,##0.00")
If TextBox1.Value = 0 Then
.TextBox3.Value = Format(CDbl(.TextBox3.Text), "#,##0.00")
End If
.TextBox4.Value = Format(CDbl(ActiveSheet.Range("X4")), "#,##0.00")
If TextBox1.Value = 0 Then
.TextBox4.Value = Format(CDbl(.TextBox4.Text), "#,##0.00")
End If
.TextBox5.Value = Format(CDbl(ActiveSheet.Range("X5")), "#,##0.00")
If TextBox1.Value = 0 Then
.TextBox5.Value = Format(CDbl(.TextBox5.Text), "#,##0.00")
End If
End With
End Sub


es sind noch mehr textboxen als die fünf , ist nur ein ausschnitt
gruß ralle

Anzeige

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

Betreff
Datum
Anwender
Anzeige
AW: textbox
10.04.2008 20:55:31
Tino
Hallo,
versuche es mal hiermit.

Dim a As Byte
For a = 1 To 5
UserForm1("TextBox" & a) = Format(Range("X" & a), "#,##0.00")
Next a


Gruß
Tino

AW: textbox
10.04.2008 21:31:00
ralf
hallo tino
tausend dank hat wunderbar geklappt
gruß ralle
Anzeige
Anzeige
Anzeige
Live-Forum - Die aktuellen Beiträge
Datum
Titel
14.05.2026 13:31:09
14.05.2026 09:50:42
13.05.2026 19:14:18