LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default Excel vba UserForm Lists not registering default values?

I had thought that excel uses VBA by default...but now that I look
back
at it I'm seeing that "A" is not in the name - I'm not actually sure
which I'm using anymore.


Excel use Visual Basic for Applications (VBA) as its macro language.
This is different than VB, which is a development platform for making
Windows applications and COM components for Windows applications.

For clarification on what I'm trying to do, I have 3 listboxes in my
userform, and 3 'description' labels for them - the labels are using
vlookup to change based on the selections in the listboxes. Since I'm
giving a default selection for all 3 lists on initialize, I wanted
those
descriptions to show in the labels. I got stuck after it seemed to
randomly decide which of the 3 lists to not recognize the value for
at


A ListBox control in VBA is what I exampled in my initial reply. By
default these are named "ListBox" with their instance number appended
to the name. (Hence ListBox1, ListBox2, ListBox3 in my example)

In Classic VB listbox controls follow the same naming, but minus "Box"
as it's commonly referred to as a "List" control. (Hence in VB my code
would be different because a List control doesn't support 'dumping'
values into its List like my example shows for the 3 ListBox controls
on UserForm1...

Private Sub Form_Click()
MsgBox Me.List1.List(List1.ListIndex) & "," _
& Me.List2.List(List2.ListIndex) & "," _
& Me.List3.List(List3.ListIndex)
End Sub

Private Sub Form_Load()
With Me.List1
.AddItem "a"
.AddItem "b"
.AddItem "c"
End With
With Me.List2
.AddItem "a"
.AddItem "b"
.AddItem "c"
End With
With Me.List3
.AddItem "a"
.AddItem "b"
.AddItem "c"
End With
End Sub


init though...hence the rebuilding and short code I pasted.


It would be better if you show ALL your code...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Registering parameter/function help for Excel User Defined Functio Jack Hoxley [MVP][_2_] Excel Programming 5 August 28th 08 10:13 AM
Multiple lists with repeated values for dependet drop down lists mcmanusb Excel Worksheet Functions 1 September 29th 06 12:13 AM
Create Outlook Distribution lists (default txt file) with excel nicolascap Excel Programming 5 March 3rd 06 04:36 PM
registering the cell values of excel combo box associated values john_stevens Excel Programming 1 May 21st 04 09:39 PM


All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"