ojef1 Posted March 1, 2011 Share Posted March 1, 2011 In my program I use an input box to accept an excel row number. However, isInt($row) returns a 0. I assume this is because inputBox only accepts strings, but when I use $row to do an _ExcelReadCell it works no problem. How is _ExcelReadCell able to decipher this without an error? The reason I ask is because I'd like to make sure the user inputs a valid integer. Any suggestions? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted March 1, 2011 Share Posted March 1, 2011 (edited) You can do that with this function, Number, the InputBox can also be set to only accept digits. Edited March 1, 2011 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
AutoBert Posted March 1, 2011 Share Posted March 1, 2011 (edited) the InputBox can also be set to only accept digits. afaik not, I only know this for Controls created by GuiCtrlCreateInput, GuiCtrlEdit but Bot for InputBox.autoBert Edited March 1, 2011 by AutoBert Link to comment Share on other sites More sharing options...
JoHanatCent Posted March 1, 2011 Share Posted March 1, 2011 afaik not, I only know this for Controls created by GuiCtrlCreateInput, GuiCtrlEdit but Bot for InputBox. autoBert Well .... this should do it? $Number = 'Yes' While StringRegExp($Number, "[^0-9]") $Number = InputBox("Numbers only!", "Enter a 1 or 2 Number Row .", "", " M2") If @error > 0 Then Exit Sleep(13) WEnd MsgBox(0, '', 'Yes, This was Row number: ' & Number($Number) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now