I have a code which asks for an input between 1-3 using an InputBox
which then runs a code depending on what input it is given. The problem i have is that i don't need that InputBox
anymore, as the work i intend to do only uses one input which is 3.I tried removing the input box and just inserting 3 there but then the code doesnt do anything. I then tried to insert a default value in the box, but it still appears and needs me to click enter which is what i am trying to avoid. Pls how should i go about this problem.
My Code
Function GetTypeFile() As Integer
Dim strInput As String, strMsg As String
Dim Default
choice = 0
While (choice < 1 Or choice > 3)
Default = "3"
strMsg = "Type in the kind of entities to create (1 for points, 2 for points and splines, 3 for points, splines and loft):"
strInput = InputBox(Prompt:=strMsg, _
Title:="User Info", Default:=3, XPos:=2000, YPos:=2000)
'Validation of the choice
choice = CInt(strInput)
If (choice < 1 Or choice > 3) Then
MsgBox "Invalid value: must be 1, 2 or 3"
End If
Wend
GetTypeFile = choice
End Function
InputBox
, if you allways put3
what is the point ? theGetTypeFile
will allways be3
. – Shai Rado Dec 5 '16 at 11:54InputBox
the code then does not do anything. and when i tried assigning the value to theGetTypeFile
directly, it still doesnt work.. – Hadiza Hamza Dec 5 '16 at 12:22inputbox
@ShaiRado – Hadiza Hamza Dec 5 '16 at 12:26