+ Reply to Thread
Results 1 to 5 of 5

Message box on text change value of a certain cell

  1. #1
    Registered User
    Join Date
    09-15-2015
    Location
    England
    MS-Off Ver
    2016
    Posts
    25

    Message box on text change value of a certain cell

    Hi ,

    I am trying to get a Yes/No MsgBox to pop up only when the value of a cell is changed for example is E3 is "London" and it gets changed to "Wales" then a Msgbox would show up.

    I am ok with coding the Msgbox itself and dealing with the yes/no responses from it, its just getting it to invoke on the text change bit I'm struggling with !

    I've searched about for a solution to this but have had no luck

    Could anyone point me in the right direction please ?

    Many thanks

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Message box on text change value of a certain cell

    Take a look at Worksheet_Change.

    If you would provide an example of what the Target could be (you mentioned E3, is it only E3 that you want the msgbox for?) Then I could show you an example.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,894

    Re: Message box on text change value of a certain cell

    See sample file.

    I used Undo to check previous contents of the cell. When Worksheet_Change event is fired, the cell has already been changed, and we do not have access to it's previous value.

    Note that during cell manipulation I switch-off Events (to avoid infinite loop of invoking Worksheet_Change again).

    Code in Sheet1 (Arkusz1) is:
    Please Login or Register  to view this content.
    To see/edit the code, rightclick on sheetname (Arkusz1) tab and select Display code from context menu).
    Attached Files Attached Files
    Best Regards,

    Kaper

  4. #4
    Registered User
    Join Date
    09-15-2015
    Location
    England
    MS-Off Ver
    2016
    Posts
    25

    Re: Message box on text change value of a certain cell

    Many thanks Guys for the responses - Kaper's solution works best for what I need although I have adjusted it a bit with regard to the MsgBox to suit my needs.

    One question is that if I try to delete the text in E3 it won't let me? any ideas why this is happening?

  5. #5
    Registered User
    Join Date
    09-15-2015
    Location
    England
    MS-Off Ver
    2016
    Posts
    25

    Re: Message box on text change value of a certain cell

    Just to let you know I have managed to resolve the delete issue - thanks again for all your help !

+ 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. How to change a cell color or show a popup message after a print function?
    By flyleclair in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-06-2013, 10:15 PM
  2. How to change a cell color or show a popup message after a print function?
    By flyleclair in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-06-2013, 09:45 PM
  3. [SOLVED] The cell or chart that you are trying to change is protected... message
    By rz6657 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 08:46 PM
  4. Replies: 2
    Last Post: 05-30-2012, 02:18 AM
  5. Change Text message within UserForm
    By USAMax in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-06-2007, 12:20 AM
  6. How to change and error message to text
    By NEWB in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-01-2005, 05:25 PM
  7. [SOLVED] Cell formual result change - Message
    By al007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2005, 09:15 AM
  8. Message box for cell change
    By Prometheus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2005, 11:11 AM

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