Hi. I have a list of named ranges that I want to delete the contents of any unlocked cells within each range. All of the ranges are on the same worksheet.

I know I can loop through each named range individually as in the example below, but I was hoping to not have to copy this 7 times, changing the name of the range each time.

How can it be done in an array? My named ranges are: RangeN_All with N being 1-7.


Sub ClearUnlockedCells()

Dim cell as range

With Sheet1
    For Each cell In Range("Range1_All")
        If Not cell.Locked Then cell.Value = ""
    Next cell
    .Range("AV10").Select
End With
End Sub