ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select Case from Text Box Input (https://www.excelbanter.com/excel-programming/313704-select-case-text-box-input.html)

mackerma

Select Case from Text Box Input
 

I would like to take the text from a text box in a userform and mak
that the criteria for a select case. I have tried the code

Cases = frmTestSel.txtSpec.Value 'I've also trie
frmTestSel.txtSpec.Text
Select Case IDNum
Case Cases
'Insert commands here
End Select

The code only works when the text box contains a single value. I hav
also tried using an Input Box instead of a Text Box on a form; th
results are the same--the case is never executed unless the bo
contains a single value only.

To be more detailed, I have 130+ "datasets". All the datasets ar
identified by an ID Number (IDNum). The code performs variou
operations on chosen datasets. I would like to be able to choos
datasets base on the ID Number, so that the user could compare dataset
1, 5, 13 and 120 for example. I know I could do this with a List Box
but I have 130+ choices, to this is a very non-ideal solution. An
other suggestions

--
mackerm
-----------------------------------------------------------------------
mackerma's Profile: http://www.excelforum.com/member.php...fo&userid=1534
View this thread: http://www.excelforum.com/showthread.php?threadid=26969



All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com