Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata
Sub test()
myValue = InputBox("Hello")
MsgBox myValue
End Sub

Validate Entry:

https://stackoverflow.com/questions/21976831/validate-entry-of-an-input-box

csvtype = InputBox(Prompt:="Enter CSV Type: Bank - Credit", Title:="Which Company Records are you Importing?")

If csvtype = "Bank" Or csvtype = "Credit" Then
MsgBox "Correct~"
Else
MsgBox "Please re-enter in the correct format!"
End If

Validate via GoTo: (Would be better to use a Control Statement probably but this works)

Public Sub Main()

InputValidation:
csvtype = InputBox(Prompt:="Enter CSV Type: Bank - Credit", Title:="Which Company Records are you Importing?")

If csvtype = "Bank" Or csvtype = "Credit" Then
  Call Import(csvtype)
  End
Else
  MsgBox "Please re-enter in the correct format!"
End If

GoTo InputValidation

End Sub
  • No labels