Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
deselect row/column from multiple selection
Selecting multiple non-adjacent rows with control click. How do I deselect
one of them. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
deselect row/column from multiple selection
Try this macro:
Sub DropARow() Set r1 = Selection n = Application.InputBox(prompt:="enter row# to be de-selected", Type:=1) Set r2 = Range(n & ":" & n) Set r3 = Nothing For Each rr In r1 If Intersect(rr, r2) Is Nothing Then If r3 Is Nothing Then Set r3 = rr Else Set r3 = Union(r3, rr) End If End If Next r3.Select End Sub -- Gary''s Student - gsnu200836 "Alan C" wrote: Selecting multiple non-adjacent rows with control click. How do I deselect one of them. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
deselect row/column from multiple selection
And a couple more from Chip Pearson.
Sub UnSelectActiveCell() Dim rng As Range Dim FullRange As Range 'Chip Pearson If Selection.Cells.Count 1 Then For Each rng In Selection.Cells If rng.Address < ActiveCell.Address Then If FullRange Is Nothing Then Set FullRange = rng Else Set FullRange = Application.Union(FullRange, rng) End If End If Next rng If FullRange.Cells.Count 0 Then FullRange.Select End If End If End Sub Sub UnSelectActiveArea() 'Chip Pearson Dim rng As Range Dim FullRange As Range Dim Ndx As Integer If Selection.Areas.Count 1 Then For Each rng In Selection.Areas If Application.Intersect(ActiveCell, rng) Is Nothing Then If FullRange Is Nothing Then Set FullRange = rng Else Set FullRange = Application.Union(FullRange, rng) End If End If Next rng FullRange.Select End If End Sub Gord Dibben MS Excel MVP On Thu, 5 Mar 2009 06:30:01 -0800, Gary''s Student wrote: Try this macro: Sub DropARow() Set r1 = Selection n = Application.InputBox(prompt:="enter row# to be de-selected", Type:=1) Set r2 = Range(n & ":" & n) Set r3 = Nothing For Each rr In r1 If Intersect(rr, r2) Is Nothing Then If r3 Is Nothing Then Set r3 = rr Else Set r3 = Union(r3, rr) End If End If Next r3.Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
multiple selection | Excel Discussion (Misc queries) | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
Multiple Column selection in pivot tables | Excel Discussion (Misc queries) | |||
how can I deselect one of the multiple selected rows? | Excel Discussion (Misc queries) | |||
ActiveChart.Deselect won't Deselect | Charts and Charting in Excel |