+ Reply to Thread
Results 1 to 4 of 4

Worksheet change endless iterations

  1. #1
    Registered User
    Join Date
    08-30-2014
    Location
    Lincoln, England
    MS-Off Ver
    Office 365
    Posts
    74

    Worksheet change endless iterations

    I am having trouble understanding the correct used of Worksheet_Change.
    When used to target a specific cell, if that cell is altered, then the change is called again... and again and again.
    I've simplified the code below to show what I mean.

    Please Login or Register  to view this content.
    What is the best way of tackling this problem, avoiding an endless cycle of calling?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Worksheet change endless iterations

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-30-2014
    Location
    Lincoln, England
    MS-Off Ver
    Office 365
    Posts
    74

    Re: Worksheet change endless iterations

    That's the one! I should have researched it first as it's been asked before, but never mind, thank you so much.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Worksheet change endless iterations

    You're welcome.

    If you have a complex procedure that might error, use an error handler to always re-enable your events.

    This is a simple error handler.

    Please Login or Register  to view this content.

+ 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. Endless loop?
    By tcfromub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2018, 05:00 AM
  2. Endless spamming
    By Pepe Le Mokko in forum Suggestions for Improvement
    Replies: 15
    Last Post: 09-07-2013, 04:30 AM
  3. Endless Loop: Comparing a set of integers from a range of column in another Worksheet
    By crisshinn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2011, 10:30 PM
  4. Change Event Endless loop :-(
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-03-2005, 06:45 PM
  5. Better Fix For Endless Do While Statement
    By RShow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2005, 08:05 PM
  6. Endless loop?
    By John in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 08-02-2005, 02:05 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