ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Value in a inputbox (https://www.excelbanter.com/excel-programming/323777-value-inputbox.html)

Alvin Hansen[_2_]

Value in a inputbox
 
Hi!
If i have a value like name in a variable
can't i get this value into a inputbox, like "is this name correct?"
and if isn't correct i can write a new name in the inputbix?

regards alvin


Jim Thomlinson[_3_]

Value in a inputbox
 
A message box is probably a better option. The code would be similar to this...

dim intReturnValue as integer

intReturnValue = msgbox("Is the name " & myVariable & " Correct?", vbYesNo,
"Confirm Name")

if intreturnvalue = vbyes then
...
else
---
endif

"Alvin Hansen" wrote:

Hi!
If i have a value like name in a variable
can't i get this value into a inputbox, like "is this name correct?"
and if isn't correct i can write a new name in the inputbix?

regards alvin


Tom Ogilvy

Value in a inputbox
 
Sub AAA()
Dim sName As String
sName = "Smith"
sName = InputBox(Prompt:="Is this Name correct" & _
vbNewLine & "Please correct if wrong", _
Title:="Name Check", _
Default:=sName)
MsgBox sName
End Sub

--
Regards,
Tom Ogilvy

"Alvin Hansen" wrote in message
...
Hi!
If i have a value like name in a variable
can't i get this value into a inputbox, like "is this name correct?"
and if isn't correct i can write a new name in the inputbix?

regards alvin




Alvin Hansen[_2_]

Value in a inputbox
 
Thanks again tom its working

regards
alvin


"Tom Ogilvy" skrev:

Sub AAA()
Dim sName As String
sName = "Smith"
sName = InputBox(Prompt:="Is this Name correct" & _
vbNewLine & "Please correct if wrong", _
Title:="Name Check", _
Default:=sName)
MsgBox sName
End Sub

--
Regards,
Tom Ogilvy

"Alvin Hansen" wrote in message
...
Hi!
If i have a value like name in a variable
can't i get this value into a inputbox, like "is this name correct?"
and if isn't correct i can write a new name in the inputbix?

regards alvin






All times are GMT +1. The time now is 08:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com