View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_5_] Jim Thomlinson[_5_] is offline
external usenet poster
 
Posts: 486
Default For Loops and Named ranges

Give this a whirl...

For i = 1 To 60
Range("ques " & i).ClearContents
Next i
End Sub

--
HTH...

Jim Thomlinson


"Ronnie" wrote:

I have ranges named in my worksheet (ques1, ques2, etc) and I would like to
use a loop to clear the contents of these ranges.

Something like:
For i = 1 To 60
Range("ques i ").Select
Selection.ClearContents
Next i
End Sub

Any suggestions on how to make this work?