Question : Macro that targets cells in the same-row cells of a named range

I need a macro that will look in a range named 'dings' and for every cell in that range which evaluates to TRUE, it will zero out all cells in the same row in the range 'AllAll'. In other words if CL17=TRUE ('dings' is in Column CL), then all the cells in Row 17 of "AllAll" will be given a zero.

Thanks,
John

Answer : Macro that targets cells in the same-row cells of a named range

John,

like this (see example)

I have assumed that dings and AllAll can be on different sheets, the code will handle eithe same or different sheets

Dave



1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Sub ZeroEm()
    Dim c As Range
    Dim rng1 As Range
    Dim ws As Worksheet
    Set ws = Range("AllAll").Parent
    For Each c In Range("dings")
        If UCase$(c.Value) = "TRUE" Then
            Set rng1 = Intersect(Range("AllAll"), ws.Rows(c.Row))
            rng1.Value = "0"
        End If
    Next
End Sub
Random Solutions  
 
programming4us programming4us