+ Reply to Thread
Results 1 to 4 of 4

Debug message / trigger and stop macro.

  1. #1
    Registered User
    Join Date
    06-02-2015
    Location
    México
    MS-Off Ver
    2010
    Posts
    7

    Debug message / trigger and stop macro.

    I would ask to your help, Im tryng to stop the code if the value in cell target is equals target value, but when i try to writ in some part of the sheet VBA send me a debug message.

    My target is:

    If target cell contains target value then run the code. (and it does but when i populate any valu in any cell VBA send me an Debug msbox)

    Somebody could help me please.


    Code in sheet 1

    Private Sub Worksheet_Change(ByVal Target As Range)

    Set Target = Range("A1")
    If Target.Value = "X" Then
    Call Desagrupar

    Exit Sub
    End If
    End Sub


    Macro un Module 1

    Sub Desagrupar()

    ' Muestra el detalle de los rangos seleccionados

    Rows(9).ShowDetail = True
    Rows(20).ShowDetail = True


    End Sub
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Debug message / trigger and stop macro.

    Hello

    Happy to help but you have made two mistakes.


    1. You have not used code tags.

    2. You have not attached a sample workbook.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)


    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    06-02-2015
    Location
    México
    MS-Off Ver
    2010
    Posts
    7

    Post Re: Debug message / trigger and stop macro.

    Sorry for the inconvenience, enclosed you will find the *.xlsm file.

    Really appreciate your help.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Debug message / trigger and stop macro.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

+ 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] Need Macro to Stop and Show Message When Error, or Continue
    By Phillycheese5 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2018, 01:25 PM
  2. Replies: 14
    Last Post: 10-19-2018, 07:23 AM
  3. [SOLVED] I want a pop-up message rather than the macro debug message, when my macro can't run
    By BTOFS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2015, 09:47 PM
  4. If cell contains text string then run macro, otherwise stop macro and popup message
    By justindk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-15-2014, 08:20 AM
  5. Message box VBA - trigger to remain constant, need VBA to stop thereafter
    By orlando212 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2013, 08:55 AM
  6. Stop a Macro if Criteria not met and Show Error Message
    By m3hool in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-17-2013, 10:12 AM
  7. Make macro stop and give message box.
    By Hjahren in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2010, 08:04 AM

Tags for this Thread

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