+ Reply to Thread
Results 1 to 5 of 5

Message box VBA - trigger to remain constant, need VBA to stop thereafter

  1. #1
    Registered User
    Join Date
    07-08-2013
    Location
    Guernsey
    MS-Off Ver
    excel 2010
    Posts
    15

    Message box VBA - trigger to remain constant, need VBA to stop thereafter

    Hey all

    I have the following code which works upto as required. However when the user selects 'ok' i need the message box to discontinue.

    The target cell will remain the same value. i.e. just a warning with no action required.

    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
    If [A1].Value < 0 Then
    MsgBox "Message here" & vbNewLine & vbNewLine & "Additional Message here", vbExclamation
    End If
    End Sub
    Any help would be appreciated.

  2. #2
    Registered User
    Join Date
    09-24-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    22

    Post Re: Message box VBA - trigger to remain constant, need VBA to stop thereafter

    Something like this:
    Please Login or Register  to view this content.
    Sorry, there was one mistake, because I rather use Yes and No
    Last edited by hudibyk; 10-31-2013 at 08:14 AM.

  3. #3
    Registered User
    Join Date
    07-08-2013
    Location
    Guernsey
    MS-Off Ver
    excel 2010
    Posts
    15

    Re: Message box VBA - trigger to remain constant, need VBA to stop thereafter

    Hi Hudibyk

    Thanks for the quick response... i see how your code is working, but still can figure out what i need to put following "vbOk" Then.

    The code / message box function appears to be looping because [A1] remains constant.

    I feel this is a simple fix and am annoyed as i cant figure it out, any additional help would be appreciated.

    Thanks

  4. #4
    Registered User
    Join Date
    09-24-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Message box VBA - trigger to remain constant, need VBA to stop thereafter

    Probbably now I understand, what you want. Try this
    Please Login or Register  to view this content.
    Additionaly read about Buttons argument in MsgBox function, especially vbDefaultButton. It may be useful for you

  5. #5
    Registered User
    Join Date
    07-08-2013
    Location
    Guernsey
    MS-Off Ver
    excel 2010
    Posts
    15

    Re: Message box VBA - trigger to remain constant, need VBA to stop thereafter

    You sir are a legend!!!!

    Just had to fix the reference in the If ans.... and that was it.

    Thanks for 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. Combine cells but one variable remain constant
    By balexander26 in forum Excel General
    Replies: 3
    Last Post: 11-10-2011, 03:23 AM
  2. Replies: 3
    Last Post: 02-26-2009, 06:51 AM
  3. cell to remain constant value in column
    By yikes in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-15-2007, 08:28 PM
  4. remain constant in a copy &amp;amp; paste
    By Viviank in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 03-18-2006, 06:35 PM
  5. [SOLVED] data source remain constant
    By maryj in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-28-2005, 08:05 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