Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Select case or If then

I develop electronic form templates in Word, however, I currently have the
opportunity to develop a shipping document in Excel. I want to insert a
dropdown in cell A1 that contains a single list of the companys plants. Once
the plant has been selected from the dropdown, the appropriate address will
proliferate cell A2. I do this using SelectCase in Word but I notice that
the construction of the code is different in Excel. I see that in Excel the
items that populate the code need to be entered into a cell range on the
spreadsheet, workbook, or external document. I also note that the Select
case in Excel seems to ask for a 'numeric' value and the anticipated returned
numeric value.....is there a counterpart I can use in Excel to get my desired
results? Best regards - Lenny
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Select case or If then

Select Case does not require a numeric value. It is native to VBA which is
the same in Excel and Word.

You can have a dropdown without using a macro. See Data=Validation using
the List Option.

Greater information is at Debra Dalgleish's site:

Debra Dalgleish
http://www.contextures.com/tiptech.html

Having a database of values on another sheet, possibly hidden will provide
the ability to lookup the address of the selected value and display it below
the dropdown

=if(A1<"",Vlookup(A1,sheet2!A:F,2,False),"")

as an example.

--
Regards,
Tom Ogilvy


"Lenny" wrote:

I develop electronic form templates in Word, however, I currently have the
opportunity to develop a shipping document in Excel. I want to insert a
dropdown in cell A1 that contains a single list of the companys plants. Once
the plant has been selected from the dropdown, the appropriate address will
proliferate cell A2. I do this using SelectCase in Word but I notice that
the construction of the code is different in Excel. I see that in Excel the
items that populate the code need to be entered into a cell range on the
spreadsheet, workbook, or external document. I also note that the Select
case in Excel seems to ask for a 'numeric' value and the anticipated returned
numeric value.....is there a counterpart I can use in Excel to get my desired
results? Best regards - Lenny

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Select case or If then

Take a look at LOOKUP() and VLOOKUP() in XL Help. Both operate with text
values as well as numeric.

With either, there's no need to enter the possible selections in a range
of cells - you could enter them directly in the function as an array.
Entering them in a range of cells *does* make for easier maintenance,
however, when locations are added or removed.

In article ,
Lenny wrote:

I develop electronic form templates in Word, however, I currently have the
opportunity to develop a shipping document in Excel. I want to insert a
dropdown in cell A1 that contains a single list of the companys plants. Once
the plant has been selected from the dropdown, the appropriate address will
proliferate cell A2. I do this using SelectCase in Word but I notice that
the construction of the code is different in Excel. I see that in Excel the
items that populate the code need to be entered into a cell range on the
spreadsheet, workbook, or external document. I also note that the Select
case in Excel seems to ask for a 'numeric' value and the anticipated returned
numeric value.....is there a counterpart I can use in Excel to get my desired
results? Best regards - Lenny

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Select case or If then

It's not necessary to have it in a cell, and it's not necessary that it be
numeric.
For instance:

Sub Testy()
a = "something"
Select Case a
Case Is = "something"
MsgBox "It's something!"
Case Is = "something else"
MsgBox "It's something else!"
Case Else
MsgBox "it's neither one"
End Select
End Sub

"Lenny" wrote in message
...
I develop electronic form templates in Word, however, I currently have the
opportunity to develop a shipping document in Excel. I want to insert a
dropdown in cell A1 that contains a single list of the companys plants.
Once
the plant has been selected from the dropdown, the appropriate address
will
proliferate cell A2. I do this using SelectCase in Word but I notice that
the construction of the code is different in Excel. I see that in Excel
the
items that populate the code need to be entered into a cell range on the
spreadsheet, workbook, or external document. I also note that the Select
case in Excel seems to ask for a 'numeric' value and the anticipated
returned
numeric value.....is there a counterpart I can use in Excel to get my
desired
results? Best regards - Lenny



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
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
Select Case AlanW Excel Programming 4 July 12th 07 07:32 AM
Case Select Daviv Excel Programming 2 March 5th 07 03:56 PM
End Select without Select Case, Block If without End If errors Atreides Excel Programming 12 November 17th 06 05:10 PM


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