Hi there,
I have the following code :
[VBA]Sub ClearRanges()
Dim ws As Worksheet
Dim nm As Name
Set ws = Worksheets("TestCode")
For Each nm In ActiveWorkbook.Names
ws.Range(nm).Select
Selection.ClearContents
Next
End Sub[/VBA]
Currently the code selects the named range and then clears the contents. However, i will be using the above code in a workbook that has hidden sheets.
Would anyone please be able to offer a solution that doesn't involve actually selecting the named ranges before clearing the conents of the named range?
Thanks,