clares said:
Hi All
The default setting for an inputbox seems to give a OK button and a Cancel button. Is there a way that I can just have the OK button?
I have tried putting the vbOKOnly in the syntax but it doesn't seem to take any notice!
Kindest Regards
Why do you want to clear the Cancel button...why not just check to see if the user pressed Cancel in your code...
<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> Test()
<SPAN style="color:#00007F">Dim</SPAN> strInput <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN>
strInput = Application.InputBox("Test this...", "Test")
<SPAN style="color:#00007F">Do</SPAN> <SPAN style="color:#00007F">While</SPAN> strInput = "False" <SPAN style="color:#007F00">'if they press cancel, it will return False</SPAN>
MsgBox "You must provide an answer for this inputbox!", vbOKOnly + vbCritical, "Test"
strInput = Application.InputBox("Test this...", "Test")
<SPAN style="color:#00007F">Loop</SPAN>
MsgBox strInput
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
</FONT>