A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
seems a bit expensive as i live in the UK. i presume i could go on line instead?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
winin:
lnWinsDue = Application.InputBox("Please enter winnings for " & WinArray(lnArrayRow, 2), _
Type:=1, Title:=gcMsgTitle, Default:=0)
Select Case lnWinsDue
Case False
GoTo theend
Case Is < 0.5
lnans = MsgBox("It's too small. Do you want to try again", vbYesNo)
If lnans = 7 Then GoTo theend Else GoTo winin
Case Is >= lnWinningsPaid
lnans = MsgBox("It's too big. Do you want to try again", vbYesNo)
If lnans = 7 Then GoTo theend Else GoTo winin
End Select
If lnWinsDue / 0.5 <> Int(lnWinsDue / 0.5) Then
lnans = MsgBox("Your entry must be a multiple of £0.05. Do you want to try again", vbYesNo)
If lnans = 7 Then GoTo theend Else GoTo winin
End If
2 I got rid of it by introducing Default=0. However if the 0 is accepted my code exits under Case False despite the fact that the var lnWinsDue =0.
3 The input box shows a "?" in the header. When selected this launches a web page on "Select a range to import to Visio". Very interesting but irrelevant. I tried using the HelpFile parameter with enties like HelpFile:-"" but got the same result.
Other that that it seems to work when normal inputs are used. Trouble is that users don't behave that way.
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
seems a bit expensive as i live in the UK. i presume i could go on line instead?
Hi michaelcoltart,
Thank you for your response. We highly recommend posting this concern to Microsoft Developer forums to better check the macro scripts that you compiled.
Please see the forum links below:
https://social.msdn.microsoft.com/Forums/en-US/...
https://developer.microsoft.com/en-us/excel/ove...
https://social.technet.microsoft.com/Forums/off...
Hope this helps.
Sincerely,
Edmund A.
Independent Advisor
I am using macros in Excel 365 Home. I need the user to input a number. On previous occassions I had used the InputBox Function which worked well with strings. Recently I discovered the Application.InputBox method and noted it could specify the input data type. It does work and rejects any non-numeric entries. However it brings other complications. I want to prevent any unsceduled events. The input should cope with whatever the user throws at it, such as an "Enter" without any value (eqivalent to a blank string) in the Box, entering 0 or any other unwanted number. I though my code covered that but the results are not as expected. The Cancel button returns False as expected. But 0 is also detected as False despite the var lnWinsDue holding 0. OK as long as 0 is not an acceptable input but certainly not what one would expect. I found out about 0 because a null entry initiated the message box I pasted to my initial post. I found that specifying a default value prevented that unwanted intrusion. My other issue is the "?" that appears in the inputbox header. As described it initiates the web browser and I cannot find a way of stopping it..
It seems that this Method is a bit cranky but I had hoped someone had travelled this road before me. If I am forced to go back to the standard input box I will have to write code to ensure I get only numeric values input. Messy!
Hope this clarifies my problem
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
Hi michaelcoltart,
I'm Ed, a fellow customer like you & an Independent Advisor.
I understand that you are having problems with the formulas in Excel.
Can you please provide more information for us to be able to diagnose the issue?
Thank you!
Sincerely,
Edmund A.
Independent Advisor