I'm using Excel 2010 and I have some code that prompts the user for a percentage then increases the value in cell A1 by that percentage. It works fine if someone plays by the rules and types an integer as a percentage. So, for example, if someone wanted the value to increase by 30%, they would type a 30 into the input box.
If someone adds a percent symbol in their response it wrecks the entire thing. How can I modify this code so it traps a percent symbol out and does the calculation based on the integer alone. Thank you.
Sub Box1()
Dim myPercent As Integer
myPercent = InputBox("How much of an increase?", "Input without the percent symbol")
Range("A1").Value = Range("A1").Value * (1 + (myPercent * 0.01))
End Sub