If you meant AA5:AB15 instead of AA5:AA15, then
![]()
Sub Test() Dim r As Range For Each r In Range("C2",Cells(Rows.Count,"C").End(xlUp)) Range(Range("C1").Value & r.Value & ":" & Range("D1").Value & r(1,2).Value).ClearContents Next r End Sub
If you meant AA5:AB15 instead of AA5:AA15, then
![]()
Sub Test() Dim r As Range For Each r In Range("C2",Cells(Rows.Count,"C").End(xlUp)) Range(Range("C1").Value & r.Value & ":" & Range("D1").Value & r(1,2).Value).ClearContents Next r End Sub
Bernie Deitrick
Excel MVP 2000-2010
perfect. it worked like a charm
the two answers worked
Last edited by thunder_anger; 11-02-2020 at 05:22 PM. Reason: forgot to thank both answers
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks