I have an inputbox that asks the user for the number of relatives they live with. But in the inputbox when I clicked on the cancel or accept button I got a type mismatch error. However, what I was able to solve was that when I click cancel or accept, I get an empty form and I simply want it to do nothing that does not execute any action.
numFamiliares = Val(InputBox("How many family members do you live with?"))
If numFamiliares = 0 Then Exit Sub
familiarActual = 1
....Here goes the rest of the code....
I simply want it not to show me the empty form as it is doing, only if the user clicks accept or cancel, simply do nothing, it must execute the rest of the code only if the number of family members is entered.Link File. Here I leave the link of the file if anyone wants to see it, it was built in execution mode.
An inputbox returns a string value so check it's not blank first, then check if it's numeric before acting on it.