Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listboxes Without User Form
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listboxes Without User Form
Why are you trying to add it in code, why not just add it in design?
-- __________________________________ HTH Bob "Vipul" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listboxes Without User Form
hello bob,
thanks for your reply and question actually i tried to add the listbox control in design mode, just straight from the Forms toolbox to my sheet but if i add it like that then i m not getting all those controls in the coding. i mean for example if i draw a listbox on my sheet, and name it as ListBox1, then i am not getting that control in code. thats why i m trying to add it using code. if you know how can i use drawn controls in coding please please let me know. thats what i wanted basically. thanks again. cheers mate "Bob Phillips" wrote: Why are you trying to add it in code, why not just add it in design? -- __________________________________ HTH Bob "Vipul" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date field in user form & Loading a user form on opening workbook | Excel Programming | |||
ref or tutorial for user forms, listboxes | Excel Programming | |||
Multi Listboxes with data dependent upon user choices | Excel Programming | |||
How to: User Form to assign a user defined range to a macro variab | Excel Programming | |||
Form/Listboxes -- problems | Excel Programming |