+ Reply to Thread
Results 1 to 5 of 5

Clear Content When a cell value = 0

  1. #1
    Registered User
    Join Date
    01-22-2017
    Location
    Wigan, England
    MS-Off Ver
    2016
    Posts
    3

    Clear Content When a cell value = 0

    Hi,
    I have a sheet that I need to clear contents on a range of cells in 1 worksheet when a specific cell = 0 on another worksheet but it just is not working and I can't see what the problem is and hoping a fresh pair of eyes can help?

    Here is my code:
    Please Login or Register  to view this content.
    I know the Reset_Fields part works as it performs perfectly when I call it using the "Run" button so the problem seems to be calling it, maybe Value =0 is incorrect?????

    Any pointers greatly appreciated
    Thanks
    Last edited by Captain Hook; 01-22-2017 at 12:10 PM.

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Clear Content When a cell value = 0

    Welcome to the forum. Please, read forum rules and use CODE tags around your code.
    The code looks OK, so I assume it's a problem where, i.e. in which Sheet Module/Module, this one and Reset_Fields are. Can you upload sample workbook.
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Registered User
    Join Date
    01-22-2017
    Location
    Wigan, England
    MS-Off Ver
    2016
    Posts
    3

    Re: Clear Content When a cell value = 0

    Hi and thanks for the reply, I've attached a similar workbook.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Clear Content When a cell value = 0

    The reason is that worksheet_change is not triggered when the cell changes as result of calculation. From the help:
    Remarks
    This event doesn't occur when cells change during a recalculation. Use the Calculate event to trap a sheet recalculation.

  5. #5
    Registered User
    Join Date
    01-22-2017
    Location
    Wigan, England
    MS-Off Ver
    2016
    Posts
    3

    Re: Clear Content When a cell value = 0

    Thanks,
    I just realised that and changed it to "Calculate" and now it works.

+ 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] Clear content referencing another cell's same content
    By papusale in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-08-2015, 05:21 AM
  2. [SOLVED] Clear Content if cell in a range contain #N/A VBA
    By alex_shin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2014, 06:33 PM
  3. How to clear cell's content?
    By NZL in forum Excel General
    Replies: 3
    Last Post: 03-09-2013, 10:04 AM
  4. Clear Cell Content Query
    By captedgar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2010, 06:25 AM
  5. Deleting cell no value by clear Content
    By pichai in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-24-2008, 07:53 AM
  6. clear the content inside the cell
    By silverskye787 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2007, 11:11 AM
  7. Clear content of cell if has some character.
    By Krzys in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-23-2007, 09:20 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