Select Case not picking up number

Status
Not open for further replies.

jrwrangler

New Member
Joined
Mar 22, 2013
Messages
16
I am using an input box with select case. I want it to let values that are under 100 and end in a zero to proceed to a msgbox that offers a reminder. For Any values that do not have a zero as the second digit to pop up an error message that lets them retry by going through the code again. When I enter values like 123 it still proceeds. Values like 12 gives me the first message box. I don't know why this is


ReTryIt2:
NumShares = Application.InputBox(prompt:="Please Enter The TOTAL Number of Shares Being Covered Today: " Title:="Shares Being Covered TODAY")
Select Case NumShares
Case Is < 100 And Mid(NumShares, 2, 1) = 0
MsgBox ("Ok, Looks Good.....")
Case Mid(NumShares, 2, 1) <> 0
MsgBox ("This Is An Invalid Entry.Please Retry")
GoTo ReTryIt2
End Select


Edit: Why did it not show up in code form??
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Status
Not open for further replies.

Forum statistics

Threads
1,207,256
Messages
6,077,317
Members
446,278
Latest member
hoangquan2310

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top