Format Control List box problem

thirulovableenemy

New Member
Joined
May 31, 2012
Messages
6
Hi Everyone

I have used/changed activex control listbox to form control list box but I can't able to perform some vba operations. Such as clear, list and add item and below is my code for activex listbox and I need to change it to form control list box. Name of the list box :List Box 45"

Please assist me

Code:
Public Sub CommandButton1_Click()
Sheets("ISIP").ListBox1.Clear
'Sheets("ISIP").ListBox2.Clear
'Sheets("ISIP").ListBox3.Clear
Sheets("ISIP").ListBox4.Clear

If ListBox2 <> "ALL" Then Range("Q31") = ""

If ListBox2 = "ALL" Then

Sheets("ISIP").Range("Q31") = "ALL"
If ListBox3 = "ALL" Then

For i = 2 To Sheets("2011").Range("A2").End(xlDown).Row
    If Sheets("2011").Range("C" & i) = ListBox1.Text Then
        Sheets("ISIP").ListBox1.AddItem Sheets("2011").Range("E" & i)
        Sheets("ISIP").ListBox1.List(Sheets("ISIP").ListBox1.ListCount - 1, 1) = Sheets("2011").Range("T" & i)
        Sheets("ISIP").ListBox1.List(Sheets("ISIP").ListBox1.ListCount - 1, 2) = Sheets("2011").Range("U" & i)
    End If
Next i

End If

Thanks
Thiru
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
You can do those things with an ActiveX control.

If your code isn't working it might be because you aren't referring to the control correctly.

Does it work?
 
Upvote 0
Actually I want to change the activex list box to form list box - In activex it works fine but in form list box it did not works.... thats the problem
 
Upvote 0
Actually I want to change the activex list box to form list box - In activex it works fine but in form list box it did not works.... thats the problem
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top