View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Vipul Vipul is offline
external usenet poster
 
Posts: 13
Default Listboxes Without User Form

hey Dave
thanks a lot mate
it worked for me.
u know i m trying to get this for last 3 days.
and finally i got it from u
many thanks bro
cheers mate


"Dave Peterson" wrote:

Use:
Dim lstCustomers As msforms.ListBox

When you used:
Dim lstCustomers As ListBox

You were using the listbox from the Forms toolbar.

Vipul wrote:

Hello people,

I have one combobox on my sheet and I am trying to put a listbox on the same
sheet.
so when i click on Add To List button it should add the selected value from
combobox to the listbox.
but i m not able to insert a listbox.
can anyone please help me with this.

This is the code i m using to insert a listbox on my sheet.
and i m getting Type Mismatch error

Sub TEST()
Dim oOLE As OLEObject
Dim lstCustomers As ListBox

Set oOLE = ActiveSheet.OLEObjects.Add(ClassType:="Forms.ListB ox.1",
Left:=537, Top:=89, Width:=120, Height:=15)

Set lstCustomers = oOLE.Object
End Sub

hope to hear something on this.
Vipul Agheda


--

Dave Peterson