Select Deselect Noncontiguous Cells

Submitted by Tom Urtis.

Ordinarily, to deselect a single cell or range on a sheet, you must click on an unselected cell to deselect all cells and then start over by reselecting all the correct cells. This is inconvenient if you need to reselect a lot of non-contiguous cells.

This sample adds two new options to the right-click menu of a selection: Deselect ActiveCell and Deselect ActiveArea. With the non-contiguous cells selected, right-click (to make active) the cell you want to deselect. The right-click menu shown in Figure 13.8 appears. Left-click the menu item that deselects either that one active cell or the contiguously selected area of which it is a part of.

Figure 13.8

ModifyRightClick procedure provides a custom right-click menu for deselecting noncontiguous cells.

X Cul IS, Ease

Pasle Special., jnseit... fielete... Cleat Contents insert Comment Format Cefc... PicJjFrom List... Add Watch Hyperlink... Deselect ActiveCell Deselect ActiveArea

0 0

Post a comment