Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Forms Combo Box Listindex set to zero

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vivek.karkun@gmail.com - 28 Nov 2007 03:18 GMT
Hello,

I am pretty much a beginnner when it comes to VBA/macro programming in
excel. I am stuck with probably the simplest problem in excel. There
is a form based combo box with all the properties specified using
format control option. I need to find a way to make the listIndex
property of the dropdown combox always set to 0, the dropdown list
should always begin from the top of the index when clicked on.

Thanks in advance.

Vic
The Dude - 28 Nov 2007 15:29 GMT
Hi,

If you want your combobox to have the value from the start, insert this code
in the form modules:

Private Sub UserForm_Initialize()
   ComboBox1.ListIndex = 0
End Sub

> Hello,
>
[quoted text clipped - 8 lines]
>
> Vic
vivek.karkun@gmail.com - 28 Nov 2007 16:03 GMT
On Nov 28, 10:29 am, The Dude <TheD...@discussions.microsoft.com>
wrote:
> Hi,
>
> If you want your combobox to have the value from the start, insert this code
> in the form modules:
>
> Private Sub UserForm_Initialize()

>     ComboBox1.ListIndex = 0
> End Sub

> "vivek.kar...@gmail.com" wrote:
> > Hello,
[quoted text clipped - 9 lines]
>
> > Vic

Hello,

Thanks for the reply, however when i use the code snippet i get a Run
time error 424- Object required. I am guessing that ComboBox1 needs to
referenced to get a handle on the ListIndex property. I am using a
Combo Box from the forms toolbar. Putting a Javascript perspective in
place i guess i need to call reference ComboBox1 like this

WorkBook.Worksheet.ComboBox1

Not sure about the syntax.

Thanks again
The Dude - 28 Nov 2007 17:10 GMT
That would be more something like userform1.combobox1

> On Nov 28, 10:29 am, The Dude <TheD...@discussions.microsoft.com>
> wrote:
[quoted text clipped - 35 lines]
>
> Thanks again
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.