+ Reply to Thread
Results 1 to 7 of 7

VBA to Confirm Change of Populated Cell Content

  1. #1
    Registered User
    Join Date
    09-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    21

    VBA to Confirm Change of Populated Cell Content

    Hey there

    Need some help here. I need some code in "Worksheet_Change" to essentially confirm if a user wants to change the content of a populated cell.

    I found some code by royUK helping with another user's request and this works perfectly except that it also fires up the message box when trying to put information in a blank cell.
    I need the confirmation box to come up only when trying to change a populated cell, not a blank cell.

    I've attached the code by royUK with small edits based on my requirement. I've got [If Target.Value <> "" Then] in there, but I'm sure I'm doing something wrong which is why it isn't working (ie. still pops up on change of any cell, including blanks).

    Please Login or Register  to view this content.
    Also, if it's not too much trouble, I'd like something similar for "Worksheet_SelectionChange" where

    Condition: if the cell is populated and a user clicks on it,
    Options: it throws out a box with 2 options "Yes" and "No"
    Yes = the cell is selected
    No = Select the first empty cell in Column B

    BTW - You guys are awesome. Cheers.
    Last edited by LEEPRIESTENATOR; 09-10-2013 at 05:14 PM.

  2. #2
    Forum Contributor
    Join Date
    09-22-2012
    Location
    Berkeley, CA
    MS-Off Ver
    Excel 2010
    Posts
    112

    Re: VBA to Confirm Change of Populated Cell Content

    Do you want to check if a cell is populated before selecting the cell? Or do you want to confirm a change after text is entered into a cell?
    ------------------------
    W2

  3. #3
    Registered User
    Join Date
    09-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: VBA to Confirm Change of Populated Cell Content

    Ok let me explain.
    I need two pieces of code, both targeting different ranges and for different purposes. The first one in "worksheet_change" as illustrated in the code above, to trigger when a populated cell's content is being changed.

    The second, a similar code under "worksheet_selectionchange" to trigger when a user clicks on a populated cell only.

    Both codes must leave empty / blank cells alone.

    For the first code, after the change is detected, the code initiates a message box with two options, yes and no. Yes = save the changes, No = revert to previous value.

    For the second code, as soon the user selects a populated cell, the code puts out a message box with two options, yes and no. Yes = leave the cell selected, No = Make the first empty cell in column B, the Active Cell.
    Last edited by LEEPRIESTENATOR; 09-11-2013 at 07:33 AM.

  4. #4
    Registered User
    Join Date
    09-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: VBA to Confirm Change of Populated Cell Content

    Thread Bump. Really hoping you guys can help with this one.

  5. #5
    Registered User
    Join Date
    09-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: VBA to Confirm Change of Populated Cell Content

    Really need some help with this. I haven't been able to figure this out so far as my VBA are almost non-existent

  6. #6
    Forum Contributor
    Join Date
    09-22-2012
    Location
    Berkeley, CA
    MS-Off Ver
    Excel 2010
    Posts
    112

    Re: VBA to Confirm Change of Populated Cell Content

    Try this:

    Please Login or Register  to view this content.
    I'm not 100% sure how you want it to work, but this is the best I could figure

  7. #7
    Registered User
    Join Date
    09-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: VBA to Confirm Change of Populated Cell Content

    You sir, are a god send. Thank you. I'll check it and get back to you.

+ 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] Change a cell populated by a dropdown when the value of the source range changes
    By AAbrams in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-29-2013, 04:10 PM
  2. Change ws3 Cell Content Depending On ws1 Content
    By heliskier89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2011, 04:52 PM
  3. Confirm editing of a populated cell with VBA
    By freud1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2010, 04:33 PM
  4. Warning - confirm cell change
    By alex3867 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-08-2006, 08:06 AM
  5. Change populated cell names via macro
    By TJM in forum Excel General
    Replies: 2
    Last Post: 09-12-2006, 10:47 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