Private
Sub
Userform_Initialize()
Dim
i
As
Integer
Dim
wks
As
Excel.Worksheet
Dim
rng
As
Excel.Range
Set
wks = ThisWorkbook.Sheets(
"Vorgaben"
)
For
i = 2
To
6
Set
rng = wks.Cells(i, 2)
me.ComboBox1.AddItem rng.Value
Next
i
Me
.ComboBox1.ListIndex = 0
i =
Me
.ComboBox1.ListIndex
Me
.cmdKostenstelle.Caption = _
HoleKostenstelle(
Me
.ComboBox1.List(i))
Set
rng = wks.Cells(2, 3)
Me
.OptionButton1.Caption = rng.Value
Set
rng = wks.Cells(3, 3)
Me
.OptionButton2.Caption = rng.Value
Set
rng = wks.Cells(4, 3)
Me
.OptionButton3.Caption = rng.Value
Me
.OptionButton1.Value = 1
Set
wks =
Nothing
Set
rng =
Nothing
End
Sub