Results 1 to 3 of 3

Clear Cell range upon Changing data in difference Range

Threaded View

  1. #1
    Spammer
    Join Date
    11-21-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    387

    Clear Cell range upon Changing data in difference Range

    I am currently using the below code to clear the data in cells K14:O48 if data in A14:B48 changes.

    The problem is, if i change data in cells NOT in the A14:B48 range, Data in K:O clears as well. How do I stop that from happening?

    Also, is there a way to change the code so that ONLY the row with changed numbers in A and B is cleared in k:o?

    (so if i only change info in cell A16, then k16:o16 clears, but the rest remains)


    Private Sub Worksheet_Calculate()
      Dim c As Range
        Application.EnableEvents = False
          For Each c In Range("A14:B48")
            If c.Value <> 0 Then
               Range(Cells(c.Row, "K"), Cells(c.Row, "O")).ClearContents
            End If
          Next c
        Application.EnableEvents = True
    End Sub
    Last edited by snuffnchess; 04-08-2016 at 01:22 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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