ok say i have 3 things loaded in a listbox it looks like this
hi!
hi1!
hi2!
how can i remove the "!" but i would also like for it to be an option so like if i put $ in a textbox it will remove all of "$" I would appreciate the help thank you!
Printable View
ok say i have 3 things loaded in a listbox it looks like this
hi!
hi1!
hi2!
how can i remove the "!" but i would also like for it to be an option so like if i put $ in a textbox it will remove all of "$" I would appreciate the help thank you!
You may have to loop through the contents of the listbox then use the REPLACE function...
i think this requires a nested for loop
well i have very little experience in vb so could you guess give me some examples?
Something like...
VB Code:
Private Sub Command1_Click() RemoveCharacter "!" End Sub Private Sub RemoveCharacter(ByVal strChar As String) Dim a As Long For a = 0 To List1.ListCount - 1 List1.List(a) = Replace$(List1.List(a), strChar, "") Next End Sub
how could i make it so whatever i put in a text box it removes?
call dee-u's function in the change event of your textbox
VB Code:
Private Sub Text1_Change() RemoveCharacter(text1.Text) End Sub
thank you all! Appreciated the help :)
Glad to be of help... :)