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

Hello.... I am trying to create user names so that when a user opens th
workbook and enters the user name into a sign on form their store numbe
and specific buying budget is entered into the beginning balance fo
forecasting. I easily did that by saying

If txtUser = apple then budget = $100,000

Now, however, I am wondering what I do if a user enters something tha
is not on the list at all? Is there a way to have the user form entr
compare to a list for validation?

And also, what do I do if the user entry is not validated? I wa
thinking about making the form read only at that point but I'm not sur
how to do this.

Any information or direction would be greatly appreciated as to ho
best to achieve this.

Thank you

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default User Name From List

If you display a listbox containing the allowed names and require that a
name be selected before the dialog is closed, that would solve your
problems.

You can put a list of names on a worksheet and then populate the listbox
with them. The following is untested but should get you close: (and
debugging is always a learning experience!)

unload userform1
dim cell as range
set cell = sheets("where my list is").range("a1")
While not isempty(cell)
userform1.additem cell.value
set cell = cell.offset(1,0)
Wend
do
Userform1.show
if userform1.listbox1.listindex < -1 then exit do
msgbox "Please make a selecton"
Loop
msgbox "You selected list item " & userform1.listbox1.listindex+1

Robert Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"novicevbaer " wrote in message
...
Hello.... I am trying to create user names so that when a user opens the
workbook and enters the user name into a sign on form their store number
and specific buying budget is entered into the beginning balance for
forecasting. I easily did that by saying

If txtUser = apple then budget = $100,000

Now, however, I am wondering what I do if a user enters something that
is not on the list at all? Is there a way to have the user form entry
compare to a list for validation?

And also, what do I do if the user entry is not validated? I was
thinking about making the form read only at that point but I'm not sure
how to do this.

Any information or direction would be greatly appreciated as to how
best to achieve this.

Thank you!


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Name From List

I'm sorry I should have stated that the users can't see a list of th
user names or they could just enter another store's username and se
their information

--
Message posted from http://www.ExcelForum.com

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
Data validation list decreases as the user chooses from the list/s Emdyey Excel Discussion (Misc queries) 1 September 9th 08 01:37 PM
data validation list: how do i 'force' a user to enter data from the list? showsomeidnow Excel Discussion (Misc queries) 4 May 1st 07 05:49 PM
data validation list: how do i 'force' a user to enter data from the list? showsomeidnow Excel Discussion (Misc queries) 2 April 29th 07 11:09 PM
User Form List Box Hank Hendrix Excel Programming 0 May 25th 04 10:22 AM
User Form / List Box Rockee052 Excel Programming 0 December 28th 03 04:55 AM


All times are GMT +1. The time now is 11:57 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"