Results 1 to 7 of 7

Need help creating a macro to clear 2 non-consecutive cells in a range

Threaded View

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    37

    Need help creating a macro to clear 2 non-consecutive cells in a range

    Hello everyone. I haven't been on the site in a while, but I'm back with a problem that should be simple, but has stumped me.
    I'm trying to create a macro that checks to see if cells b12:c12 are empty and if they are clears the cell contents of k12.
    I also want a separate macro that checks to see if cell g36 is empty and if it is then clears the cell contents of k36.
    Below is the macro that I have that accomplishes the first part, but I can't figure out how to include a macro that solves the second part of my problem.

    Thanks in advance for any assistance that anyone can provide.
    ***************************************************
    Private Sub Worksheet_Change(ByVal Target As Range)
    
        If Not Intersect(Target, Range("b12:c12")) Is Nothing Then
            Worksheets("Leadsheet").Range("k12").ClearContents
        
        End If
    End Sub
    Last edited by gophil1; 05-07-2019 at 08:12 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to clear cells in range & move up if certain cells meet criteria
    By samder68 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2016, 10:52 PM
  2. [SOLVED] Macro to Clear contents in a range of cells when Date change.
    By aneshdas in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-08-2014, 01:53 AM
  3. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  4. [SOLVED] Macro needed to clear cells in range based on value of cells in another range
    By msmith7113 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2013, 12:32 AM
  5. [SOLVED] Clear contents for consecutive duplicates in selected range
    By AM0305 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-30-2013, 09:04 PM
  6. Replies: 3
    Last Post: 09-18-2012, 11:32 AM
  7. Replies: 2
    Last Post: 06-21-2011, 12:54 AM

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