Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I worte a code to select a range of cells, deselect the last row in the range then clear the selection's contents. The code is: Range("E10:Jan").Select Selection.Resize(Selection.Rows.Count - 1, Selection.Columns.Count).Select Selection.ClearContents The problem is that i have 20 non-adjacent ranges that i want to apply the above code to. Is there a way to loop through non-adjacent selections rather than having to type this code 20 times? I managed to select the non-adjacent ranges using one line as follows: Range("E10:Jan, J10:Feb, P10:Mar, ..... etc").select but i don't know how to resize all of these ranges together. I tried using the offset method hoping to shift all the selections one row up, but it worked on one selection only rather than the whole lot. Is there something similar to For each Selection in activesheet.selections Deselect the last row in the selection Selection.ClearContents Next Selection Any ideas? i'm using Excel 2003 Many thanks Tendresse |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
highlight color missing when selecting cell ranges with CTRL key | Excel Discussion (Misc queries) | |||
Selecting adjacent cell | Excel Programming | |||
VIEWING adjacent/nonadjacent cells or cell ranges in Excel 2007 | Excel Discussion (Misc queries) | |||
selecting different cell ranges across sheets, to display on summary page | Excel Discussion (Misc queries) | |||
selecting adjacent cells | New Users to Excel |