Fixing the Clear Cell Macro

EE Pros,

I have a great WS that Martin Liss has helped create for a situation where you make choices by clicking black boxes (in Col. A) and the selection changes the color (to show selection) and it runs through some math to produce a result at the bottom of each table.

Here's the issue.  We now have the ability to "clear the list of selections (The CLEAR BUTTON).  While it does clear the selections, it doesn't reset the math to have -0- at the bottom of the cells at the bottom of each table.  I need someone to look at this macro under the CLEAR Button and figure out what needs to be added in order to reset the tables and math at the bottom of each Table.

Make sure you make a copy of the original WB; when you start troubleshooting the Macro, you will find that you can't go back to the start.

Thank you in advance,

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Sub ClearNR()
'Clear Named Ranges (NR) for the check boxes (INDICATOR2)
Dim nrUseCase As Name
Dim nrRange As Range
Dim rngRow As Range
Dim intPos As Integer
For Each nrUseCase In ThisWorkbook.Names
    If Left$(nrUseCase.Name, Len(INDICATOR2)) = INDICATOR2 Then
        intPos = InStr(1, nrUseCase.RefersTo, "!")
        Set nrRange = Range(Mid(nrUseCase.RefersTo, intPos + 1))
        For Each rngRow In nrRange.Rows
            rngRow.Columns(1) = ""
            rngRow.Columns("E:G").Interior.Color = RGB(200, 200, 200)
    End If
Application.ScreenUpdating = False
Application.ScreenUpdating = True
End Sub

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bright01Author Commented:

GREAT!  Thank you!  That works incredibly well.  I'm going to be authoring another question about how to properly use Protection On and still have the Worksheet work properly next.

Thanks again for some great code and coaching.  I continue to learn something new every time you help me out.

Much thanks,

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.