Hallo zusammen,
ich bin Anfänger und habe mir einen Code gebastelt der mehrere Listboxen in einer Userform formatieren soll. Es funktioniert auch, aber da ich mehrere Codes in die Userforn einfügen will wird die Sache sehr unübersichtlich und vor allen sehr lang. Ich füge meinen Code ein, ich denke und bin sicher das geht wesentlich kürzer. Für jede Hilfe bin ich sehr dankbar. Vorab vielen Dank, Tom
Private Sub UserForm_activate()
Me.Left = (Application.Width - Me.Width) / 2
Me.Top = (Application.Height - Me.Height) / 2
With ListBox1
.TextAlign = fmTextAlignRight
End With
With ListBox2
.TextAlign = fmTextAlignRight
End With
With ListBox3
.TextAlign = fmTextAlignRight
End With
With ListBox4
.TextAlign = fmTextAlignRight
End With
With ListBox5
.TextAlign = fmTextAlignRight
End With
With ListBox6
.TextAlign = fmTextAlignRight
End With
With ListBox7
.TextAlign = fmTextAlignRight
End With
With ListBox8
.TextAlign = fmTextAlignRight
End With
With ListBox9
.TextAlign = fmTextAlignRight
End With
With ListBox10
.TextAlign = fmTextAlignRight
End With
With ListBox11
.TextAlign = fmTextAlignRight
End With
With ListBox12
.TextAlign = fmTextAlignRight
End With
With ListBox13
.TextAlign = fmTextAlignRight
End With
With ListBox14
.TextAlign = fmTextAlignRight
End With
With ListBox15
.TextAlign = fmTextAlignRight
End With
With ListBox16
.TextAlign = fmTextAlignRight
End With
With ListBox17
.TextAlign = fmTextAlignRight
End With
With ListBox18
.TextAlign = fmTextAlignRight
End With
With ListBox19
.TextAlign = fmTextAlignRight
End With
With ListBox20
.TextAlign = fmTextAlignRight
End With
With ListBox21
.TextAlign = fmTextAlignRight
End With
With ListBox22
.TextAlign = fmTextAlignRight
End With
With ListBox23
.TextAlign = fmTextAlignRight
End With
With ListBox24
.TextAlign = fmTextAlignRight
End With
End Sub
|