Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
acw acw is offline
external usenet poster
 
Posts: 19
Default Data validation with the Select Case statement

Billabong

Try:
Private Sub CommandButton1_Click()
Select Case Cells(5, "F") '= "istext()"

Case "trillium"
Cells(2, "B") = "trillium"
Cells(3, "B") = "456 maple rd."

Case "brooks"
Cells(2, "B") = "Brooks ltd"
Cells(3, "B") = "123 maple rd."

Case "peterson"
Cells(2, "B") = "peterson ltd"
Cells(3, "B") = "789 maple rd."

Case Else
Cells(2, "B") = ""
Cells(3, "B") = ""

End Select
End Sub

If you want to make sure there is something in F5 before
you start, then perform the test and only move onto the
Select statement if it is valid.

eg If WorksheetFunction.IsText(Cells(5, "F")) Then ...


Tony

-----Original Message-----
Hello

Iam trying to use a drop down list created by data

validation to
generate an address. The user selects the name then

presses command
buton to make address appear. When I run the program

below it does
not select the correct address with respect to the name

of company in
drop down list. For example if I select Brooks in drop

down list it
displays trilliums address

Can anyone figure this out- TIA

Private Sub CommandButton1_Click()

Select Case Cells(5, "F") = "istext()"

Case Cells(5, "F") = "trillium"
Cells(2, "B") = "trillium"
Cells(3, "B") = "456 maple rd."

Case Cells(5, "F") = "brooks"
Cells(2, "B") = "Brooks ltd"
Cells(3, "B") = "123 maple rd."

Case Else Cells(5, "F") = "peterson"
Cells(2, "B") = "peterson ltd"

End Select

End Sub


.

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
How do I get a Data validation list to select another validation l langston35 New Users to Excel 1 September 28th 09 08:38 AM
Select Case Statement Katie Excel Worksheet Functions 13 December 1st 08 08:32 PM
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
case sensetive data validation [email protected] Excel Worksheet Functions 5 January 27th 07 12:14 PM
import external data sql case statement burkecrosby Excel Discussion (Misc queries) 0 January 25th 07 05:26 PM


All times are GMT +1. The time now is 12:21 AM.

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"