Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Dialogue Box With Field?

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    Nanaimo, BC
    Posts
    49
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

  2. #2
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •