Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good afternoon
I am trying to loop thru all ranges on a particular worksheet (sheet2) and execute the command Range("loopthruallranges").ClearContents. the clearcontents was provided by MVP Rick and it does exactly what i want to do but my problem is resolving the names of the individual ranges so that “loopthruallranges” can be replaced by a variable. I believe it has to be something like Sub clearcontents() dim rn as string for each range in worksheet (sheet2) range. x=range.name x.clearcontents Next end sub But I have tried a multitude of different schemes and I get odd errors. I have also notice active sheet can have impact on range names that are enumerated. Any help is appreciated. BRC |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I reference a Range of cells in excel using variable names | Excel Programming | |||
Variable Names Range - Help Needed | Excel Programming | |||
Range("C100:D200").Select with variable names | Excel Programming | |||
Variable names for named range | Excel Discussion (Misc queries) | |||
'ActiveWorkbook.Names.Add Name:' how to make range variable? | Excel Programming |