Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default User Form Question

I am trying to do the following three things on a userform.
1. show a listbox that the user would be able to review a row of names
( no selection just visual update )
2. show a list of potential additional names ( user would be able to
click select the choice )
3. show a ' text input box' ( my descriptive name ) (this would allow
user to type in a name)

I think 1 & 2 are typical things I can program, however, I don't seem to
find any information on how to do 3. Might well be that all the looking I am
doing is for the wrong name?

Can someone tell me what to code or call this desire so I can code some
more? If there is nothing, anybody have an idea. It is very important that
the user should be able to review and see what names have been used.

Thanks in advance for your help.

Ray


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default User Form Question

If you are adding a list box then just add a textbox. But you say there
won't be any selection made for #1, then why not add a Label instead. That
will show all the names instead of the user scrolling for all the names. It
will be right beside your listbox icon on the tools menu bar.
For number 2 you can add either a combo or list box. Programmers choice,
don't see no difference except for the drop down and not the scroll.
In your userform initialiaze event just add:
Listbox1 or Combobox1.AddItem "Joe"
Listbox1 or Combobox1.AddItem "Frank"
etc.
If you are wanting the textbox to show what the user has chosen then just
add:
Textbox1.Value = Listbox1.Value & Listbox2.Value
Other than that the textbox will be blank for the user to type whatever they
want.
I hope I understood what you were asking. If not sorry for the
misdirection.
HTH
"Ray Batig" wrote in message
link.net...
I am trying to do the following three things on a userform.
1. show a listbox that the user would be able to review a row of names
( no selection just visual update )
2. show a list of potential additional names ( user would be able to
click select the choice )
3. show a ' text input box' ( my descriptive name ) (this would allow
user to type in a name)

I think 1 & 2 are typical things I can program, however, I don't seem to
find any information on how to do 3. Might well be that all the looking I

am
doing is for the wrong name?

Can someone tell me what to code or call this desire so I can code some
more? If there is nothing, anybody have an idea. It is very important

that
the user should be able to review and see what names have been used.

Thanks in advance for your help.

Ray




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default User Form Question

Assume names for Listbox1 are in row 2 starting in column A.
Private Sub Textbox1.Exit()
dim rng as Range, cell as Range
if len(trim(Textbox1.Text)) < 0 then
' get end of the row of names
set rng = cells(2,"IV").End(xltoLeft)(2)
rng.Value = Textbox1.Value
set rng = Cells(cells(2,1),rng)
Listbox1.Clear
for each cell in rng
listbox1.AddItem cell.Value
next
End if
End Sub

since your list of names is horizontal, you will need to use additem to get
them in your first listbox (item 1 below).

--
Regards,
Tom Ogilvy

Ray Batig wrote in message
link.net...
I am trying to do the following three things on a userform.
1. show a listbox that the user would be able to review a row of names
( no selection just visual update )
2. show a list of potential additional names ( user would be able to
click select the choice )
3. show a ' text input box' ( my descriptive name ) (this would allow
user to type in a name)

I think 1 & 2 are typical things I can program, however, I don't seem to
find any information on how to do 3. Might well be that all the looking I

am
doing is for the wrong name?

Can someone tell me what to code or call this desire so I can code some
more? If there is nothing, anybody have an idea. It is very important

that
the user should be able to review and see what names have been used.

Thanks in advance for your help.

Ray




Reply
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
User Form question ah Excel Discussion (Misc queries) 1 November 5th 07 10:40 AM
user form question: text box to display result BigPig Excel Worksheet Functions 0 February 25th 06 08:17 PM
User form question Haas[_2_] Excel Programming 4 November 27th 03 10:25 AM
User form question Gareth[_3_] Excel Programming 2 November 20th 03 09:37 PM
User form question Gareth[_3_] Excel Programming 1 October 29th 03 06:07 PM


All times are GMT +1. The time now is 12:16 PM.

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

About Us

"It's about Microsoft Excel"