how can i get a string prompted from my user?
ex.: i click a button, it shows a message box asking for something, like your name, how can i do this???
Thank you,
Guilherme Costa
Printable View
how can i get a string prompted from my user?
ex.: i click a button, it shows a message box asking for something, like your name, how can i do this???
Thank you,
Guilherme Costa
Use the InputBox function.....
How do you use this input box??
Type the word "Inputbox" click on it and press F1.Quote:
Originally posted by gccosta
How do you use this input box??
Bingo !
InputBox is much like MsgBox, but it returns a string. This is not the worlds best function, and I rarely use it, but it sure is fast to implement. I don't like it because it is so constrained in appearance and functionality.
VB Code:
Dim strName As String strName = InputBox("Please enter your name below then press enter.", "Enter your name please") Select Case LCase(strName) Case "" MsgBox "You didn't enter a name, silly.", vbOKOnly + vbInformation, "Bah!" Case "carp" MsgBox "You're not Carp, Carp made this small example for you though", vbOKOnly + vbInformation, "Silly" Case Else MsgBox "Your name doesn't seem to be in our case, Try something else!", vbOKOnly + vbInformation, "Who are you?!?!?" End Select