Dialogue Box With Field?

kwaring

New Member
Joined
Mar 14, 2002
Messages
49
Is there a way to make a message box have a dialogue box in which the user can type a value and then write that value to a cell? Also, how do I make different buttons at the bottom of a dialogue box and change the action they perform when pressed? For example, if I have a dialogue box pop up and display a value contained in a cell and the user decides that value is wrong, can I make another popup box that allows him to change the value? So I would need an "OK" button, a "Change" button, a "Delete" button and a "Cancel" button. Thanks
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You could design a user form and develop lots of code to support it, but for your sake, I recommend using XL's built in dialog box in a manner similar to below, seems like you can kill all your birds with one stone.

Code:
Sub DialogueBoxWithField()
n = Application.InputBox(prompt:="Cell A1 has the following Value: " _
        & [a1].Value & Chr(13) & Chr(13) & "Please confirm or change the value.", _
        Title:="Action Required", Default:=[a1].Value)
If n<> False Then [a1] = n
End Sub

Change a1 to the cell of your choice. This shows the value, you can cancel, you can overwrite, you can clear and much easier to put in place.

Cheers, Nate
This message was edited by NateO on 2002-05-03 15:33
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,734
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top