+ Reply to Thread
Results 1 to 11 of 11

Prompt user with MsgBox to edit a value of a cell.

  1. #1
    Registered User
    Join Date
    02-27-2007
    Location
    Jackson, MS
    MS-Off Ver
    365
    Posts
    96

    Prompt user with MsgBox to edit a value of a cell.

    Is there a way to use a message box to prompt a user to edit the contents of a cell if a value is already there?

    The cell I am referring to (D1) has long text string values in it occasionally so instead of a message box asking for a new value each time to be typed in it would be helpful for the message box to contain what is already in the cell giving the user the opportunity to edit that value.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: Prompt user with MsgBox to edit a value of a cell.

    It is quite easy but it requires VBA. What event do you want to use to trigger showing the message box?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    02-27-2007
    Location
    Jackson, MS
    MS-Off Ver
    365
    Posts
    96

    Re: Prompt user with MsgBox to edit a value of a cell.

    Here's my code. Very simple.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor jomaor1's Avatar
    Join Date
    10-08-2018
    Location
    Brasil
    MS-Off Ver
    Excel 2016
    Posts
    177

    Re: Prompt user with MsgBox to edit a value of a cell.

    I didn't quite understand your question, but did you mean like this? :


    Please Login or Register  to view this content.
    John.

    "I excel at jumping to conclusions"

  5. #5
    Registered User
    Join Date
    02-27-2007
    Location
    Jackson, MS
    MS-Off Ver
    365
    Posts
    96

    Re: Prompt user with MsgBox to edit a value of a cell.

    Quote Originally Posted by jomaor1 View Post
    I didn't quite understand your question, but did you mean like this? :


    Please Login or Register  to view this content.
    Thanks for the reply but your code skips the message box if cell D1 contains a value. I would like for the message box to include the value in it when it pops up so the user does not have to retype the whole value. Just make changes to it. For instance if the value below just needed a "-1" added to it then all they would have to type is "-1" instead of the whole thing.

    Below is an example of what it would look like when it pops up with the cursor sitting at the end of the value-

    Attachment 621335

  6. #6
    Forum Contributor jomaor1's Avatar
    Join Date
    10-08-2018
    Location
    Brasil
    MS-Off Ver
    Excel 2016
    Posts
    177

    Re: Prompt user with MsgBox to edit a value of a cell.

    oh.... Now I get it, it's very simple,

    just change this line on the code:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-27-2007
    Location
    Jackson, MS
    MS-Off Ver
    365
    Posts
    96

    Re: Prompt user with MsgBox to edit a value of a cell.

    That works very well. Thank you!

    I do have one more request though. Is there a way to add a SendKeys "End" command so the cursor is waiting at the end of the value in the box for typing? Currently if someone were to just start typing it would overwrite the value in the box.

    Attachment 621390

  8. #8
    Forum Contributor jomaor1's Avatar
    Join Date
    10-08-2018
    Location
    Brasil
    MS-Off Ver
    Excel 2016
    Posts
    177

    Re: Prompt user with MsgBox to edit a value of a cell.

    i don't recall any method to do that kind of manipulation with VBA. But i can think of a workaround:

    Please Login or Register  to view this content.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: Prompt user with MsgBox to edit a value of a cell.

    Quote Originally Posted by go3go3go View Post
    I do have one more request though. Is there a way to add a SendKeys "End" command so the cursor is waiting at the end of the value in the box for typing? Currently if someone were to just start typing it would overwrite the value in the box.

    Attachment 621390
    The InputBox is a modal form so once it is displayed your code can't do anything, such as SendKeys, until the user dismisses it. What you describe here can be done with a custom UserForm. I could show you if you provide your file. None of your attachments above are valid; follow these steps to attach a file:

    The paper clip icon does not work for attachments. To attach a file, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.

  10. #10
    Registered User
    Join Date
    02-27-2007
    Location
    Jackson, MS
    MS-Off Ver
    365
    Posts
    96

    Re: Prompt user with MsgBox to edit a value of a cell.

    Here it is. Thank you very much for your help!
    Attached Files Attached Files

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: Prompt user with MsgBox to edit a value of a cell.

    Please try this.

    I strongly recommend to everyone that they declare variables. Doing so prevents a lot of bugs and runtime errors.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] With MsgBox Edit of a cell
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-11-2017, 03:01 AM
  2. Macro to capture MsgBox prompt to a string variable but ignore the MsgBox
    By BuglerDobbs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2015, 10:56 AM
  3. Prompt password when edit the cell
    By vaibhavch in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-30-2014, 07:03 AM
  4. Password prompt only when edit the cell
    By vaibhavch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2014, 07:02 AM
  5. InputBox prompt user to select no more than 3 columns else error msgbox then try again
    By Littleeleven in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2013, 10:54 AM
  6. Edit code to loop error msgbox and inputbox until valid date is entered by user.
    By rocksan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2012, 10:07 PM
  7. Prompting a MsgBox upon row/cell edit
    By kid_epicurus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-23-2012, 03:23 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1