Hi all

I have a six windows, and on them I have there five objects ListBox but every have different names. e.g LstCity, LstNames, LstHouses, Lst Peoples and LstCars.


if I would like to execute the same on the all objects (on a one form) then I can this make so - using the loop: For…each O.K. I understand it
Code:
Option Explicit

Private Sub ClearListBox()
    Dim ctl As Control
    ' Clear all the ListBoxes on a one form.
    For Each ctl In Controls
        If TypeOf ctl Is ListBox Then ctl.List = ""
    Next ctl
End Sub

Private Sub cmdClear_Click()
    ClearListBox
End Sub
However…..
I want to execute the same on at will chosen object only and on a one at will chose forms - when this form is actively obviously. How to make it? How to make one code for objects with different name, on a different forms?

will be usefully some example code

thank in advance