Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
For Loops and Named ranges
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
For Loops and Named ranges
if you want to clear all of the ranges
Option Explicit Dim nm As Name Sub Clear_rnge() For Each nm In ThisWorkbook.Names Range(nm).ClearContents Next End Sub -- Gary "Ronnie" wrote in message ... 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Like 123, allow named ranges, and print named ranges | Excel Discussion (Misc queries) | |||
named ranges - changing ranges with month selected | Excel Programming | |||
named ranges, I think | Excel Programming | |||
Ranges / Loops | Excel Programming | |||
Named ranges | Excel Programming |