+ Reply to Thread
Results 1 to 8 of 8

Require help to stop annoying running of macro

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Require help to stop annoying running of macro

    Dear friends,
    The code is working fine but when I run it and then go to cell g7 or a8 to check the output the macro runs automatically which is very annoying for me. Because of it I’m unable to check the output of it. I don’t want any action while checking the output of it after once running it. In short if there is any value in cells g7 or a8 then no action require until I delete the value in cell g7 and enter a new value in g7.

    I want the second output when I delete the value in g7 and enter a new value.

    The code is as follows:

    Please Login or Register  to view this content.
    Any help will be appreciated.

    Thanking you,
    Sincerely,

    mso3

  2. #2
    Registered User
    Join Date
    10-24-2011
    Location
    SA, Australia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Require help to stop annoying running of macro

    Hi mso3

    Thats a very similar problem to one I posted 4 minutes before you ! Hopefully the response to mine or yours will work for us both.

    the old fogey

  3. #3
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Require help to stop annoying running of macro

    Hi djon5020,
    Where is the solution?

    Waiting to receive it positively.
    Thank you,

  4. #4
    Registered User
    Join Date
    10-24-2011
    Location
    SA, Australia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Require help to stop annoying running of macro

    Hi again

    I think I have solved mine. It may work for you.

    Heres the link to my post http://www.excelforum.com/excel-prog...ml#post3924567

    Good luck
    the old fogey

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Require help to stop annoying running of macro

    You are using the Worksheet_SelectionChange event, so anytime you select a cell in the worksheet, the code activates.
    If you want the code to only work when a specified cell is selected, you need to set it up that way, for example.
    The below code only activates when you select A8 or G7
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Require help to stop annoying running of macro

    Hi Davesexcel,
    I don't want any change after selecting the cell after running the code first time until I enter another number in g7. I have to check the output of the code and take print out. At this time I dont want any change in these both cells. Next time when I enter new number in g7 then it should change as before.
    Please see the workbook which is annoying me and not allowing me to check the output.

    Thank you.
    Attached Files Attached Files

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Require help to stop annoying running of macro

    Then you shouldn't use the Worksheet_SelectionChange event. Use something else.

    The code you are still using is confusing , I don't know what you are trying to do. Also the code does not work fine as you say, every time I opened your workbook, I get worksheet.select errors and global errors.

  8. #8
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Require help to stop annoying running of macro

    Hi Davsexcel and Jon,
    Thank you. I don't know why the code is giving error from your end. It's working fine and changing the numbers in a8 automatically after entering any number in g7 and hitting enter key or change the cell by arrow key to right direction.

    I have added two lines in it to avoide the problem of annoying and changing values in a8 each time after selection but now getting compile error 424 object require in the following code amendment.

    Please Login or Register  to view this content.
    if you have any new approach to achieve it please do share it with me. Is there any way to change receipt number function into a standard module code so that I will run a macro whenever I need which will be better than automatic after hitting enter key in g7.

    Thank 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] Stop Macro from running after certain row?
    By balston2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2012, 12:34 PM
  2. Stop a running macro
    By Frank e in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-18-2008, 02:07 PM
  3. Macro won't stop running!
    By wizard007 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-05-2007, 06:09 AM
  4. Stop a macro from running
    By davidakemp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-29-2005, 05:38 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