Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to zero out non-contiguous ranges
for each cell in Range("A2:A35")
if cell.locked = False then cell.clearcontents end if Next -- Regards, Tom Ogilvy "Dean" wrote: I have a range name which involves about four non-contiguous blocks of contiguous cells (say, cells a2 to a4, then a7 to a12, then a15 to a18, then a30 to a35, right now, though I might later insert some rows in the middle, so the range name's cells would adjust). I would like to just set all cells in these blocks to zero with a macro in the easiest way possible. Actually, easier yet, would be to set the whole range to zero from cells a2 to a35, but have it skip any cells whose format is protected, whether or not protection is actually on. Can someone give me the code to do that? Thanks! Dean |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Non contiguous ranges | Excel Programming | |||
vlookup on non-contiguous ranges | Excel Worksheet Functions | |||
summing non contiguous ranges | Excel Discussion (Misc queries) | |||
sorting non contiguous ranges | Excel Discussion (Misc queries) | |||
Borders - non-contiguous ranges | Excel Programming |