ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   dialogboxes (https://www.excelbanter.com/excel-programming/271155-dialogboxes.html)

jonas

dialogboxes
 
Hi,
how do I programme dialogboxes where i put in values/text
to be entered in specified cells? What I would like to
have is an macro which presents an dialogbox where it
asks the user for a value or text and then waith until a
value has been entered before proceeding to the next
command in the macro.

Kind regards

Jonas

Keith Willshaw

dialogboxes
 

"Jonas" wrote in message
...
Hi,
how do I programme dialogboxes where i put in values/text
to be entered in specified cells? What I would like to
have is an macro which presents an dialogbox where it
asks the user for a value or text and then waith until a
value has been entered before proceeding to the next
command in the macro.

Kind regards

Jonas


The simplest method is to use the InputBox Function

example

Dim Message, Title, Default, MyValue
Message = "Enter a value between 1 and 3" ' Set prompt.
Title = "InputBox Demo" ' Set title.
Default = "1" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)

Keith



Jan Karel Pieterse

dialogboxes
 
Hi,

like this:

Sub test()
With ActiveSheet
.Range("a1").Value = InputBox("Enter a value for
A1", "Input Data Please!", 1)
.Range("a2").Value = InputBox("Enter a value for
A2", "Input Data Please!", 1)
.Range("a3").Value = InputBox("Enter a value for
A3", "Input Data Please!", 1)
End With
End Sub


Regards,

Jan Karel Pieterse
Excel TA/MVP

-----Original Message-----
Hi,
how do I programme dialogboxes where i put in values/text
to be entered in specified cells? What I would like to
have is an macro which presents an dialogbox where it
asks the user for a value or text and then waith until a
value has been entered before proceeding to the next
command in the macro.

Kind regards

Jonas
.



All times are GMT +1. The time now is 02:09 AM.

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