Gruppe
Dialog
Problem
Wie kann ich in XL8 über die AddItem-Methode eingefügte Einträge in einer ListBox gegen neue Begriffe austauschen?
StandardModule: basMain
Sub CallForm()
frmChange.Show
End Sub
ClassModule: frmChange
Private Sub cmdContinue_Click()
Unload Me
End Sub
Private Sub lstDays_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim iIdx As Integer
Dim sNew As String
sNew = InputBox("Neuen Eintrag eingeben:")
If sNew = "" Then Exit Sub
With lstDays
iIdx = .ListIndex
.RemoveItem .ListIndex
.AddItem sNew, iIdx
End With
End Sub
Private Sub UserForm_Initialize()
Dim iCounter As Integer
For iCounter = 1 To 7
lstDays.AddItem Format(Weekday(iCounter), "dddd")
Next iCounter
End Sub