Questions tagged [select-case]

164 questions
-1
votes
1 answer

Shorten case select [formula populating] code because procedure is too large

I've made a sub which has become too large due to my select case, which is from 1 to 16. For select case 1 cells on line 2 get a formula filled in (sheet3) lines are hidden from 32 down (sheet3) For select case 2 cells on line 32 gets the same…
Renate
  • 3
  • 4
-1
votes
1 answer

Select Case in vb.net windows program

Using a select case write a vb.net program that makes a decision when a driver over-speeds, displays the decision on label changing the color of the label for each decision. Dim speed As Integer Dim diff As Integer 'speed limits Dim…
-1
votes
1 answer

How to use SELECT CASE with TO using INTEGER

I am trying to use SELECT CASE in my code. but even the value of the variable is in between the set value in SELECT CASE it does not hit the code inside that case. for example: Dim i as Integer = 27 Select Case i Case 3 To 33 'This would…
Boooo Booooo
  • 57
  • 1
  • 2
  • 11
-1
votes
1 answer

Check specific dates using select case

I have two tables. One contains data with some dates, and second one consist all public holidays. My task is to determine let's say DayType for each record in the table. For example if date is '2015-09-08 22:33' then output is "Sunday/Night Shift"…
Josef
  • 2,648
  • 5
  • 37
  • 73
-1
votes
1 answer

MS Access VBA SQL query debugging select case

In MS Access 2013 VBA I get a syntax error in this SQL-string: strSQL = "INSERT INTO [man_year] ( man_year_val, year_int, main_research_area, organisation, man_year_source ) SELECT KU.[2007], '2007' AS Expr1, " _ & "select case…
pmelch
  • 101
  • 1
  • 3
  • 9
-2
votes
1 answer

VBA select case statements with variable set as relative cell giving off circular reference error

I am looking to utilize the user defined formula below to create a variable (cell_val) that is compared across a number of select case statements to return a specific sumif function result. the only variable that changes in the sumif function given…
-2
votes
1 answer

How to make a select case non-blocking in for loop without default

I have this piece of code. func Start() bool { for { if checkSomthingIsTrue() { if err := doSomthing(); err != nil { continue } } select { case <-ctx.Done(): …
-2
votes
2 answers

Jump from Cases in the same switch vb.net

I am building a game and I need to jump from Case to another. For example if the player is in the box 5 then the avatar needs to move to the box 9. Any help is highly appreciated.` Case 5 OBJETO_ATERIOR = R4 …
ripepe
  • 45
  • 5
-2
votes
1 answer

Loop without Do error within Select Case statement

When running this code I get a error that is "loop without do". I want if "case vbno" is selected then it returns to the original input box. If it the user selects "case vbyes" I want it to highlight then cell then loop back to do and return to…
Mitch
  • 1
  • 1
-2
votes
2 answers

return value from select case

How can I get the value from the expression in my Select Case statement? When we write select case statements, we are told that good practice is to have a case else at the end. I understand the purpose of this to be if we don't think of all possible…
CWilson
  • 425
  • 10
  • 28
-2
votes
1 answer

How to make rows that don't satisfy a certain condition not appear in a result

I have a table T1 with the following columns and rows/row data: table T1 child_id | childOne | ChildHired | ChildProgress 1 Yes No Good 2 No No Poor 3 …
Nsengiyunva
  • 11
  • 1
  • 9
-3
votes
3 answers

(Select Case) If textbox contains "phrase" then output

I'm making a simple chatbot that acts like my friend. (Example) if inputtxt contains the word "water" then outputtxt says "Water falls from the sky." So if the inputtxt says "What do you think of water" it will recognize water and says "Water falls…
JoshPaulie
  • 78
  • 1
  • 7
-3
votes
1 answer

Exit Select Case - VBA MsAccess

I need to exit the select case in vba ms access but I cant figure how to do it, this is a screen shot of the error I get.
Osama_Almaani
  • 896
  • 7
  • 16
-4
votes
1 answer

Select Case(Switch) formula in Excel

Before Office16 (https://support.office.com/en-us/article/SWITCH-function-47ab33c0-28ce-4530-8a45-d532ec4aa25e) there is no formula for Switch. I used to use multiple IF formulas, or VLOOKUPs. So I have created an UDF for these cases, it is in the…
donmichael
  • 68
  • 6
1 2 3
10
11