View Single Post
  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Gallant

I have added right-click menu items assigned to these two macros from Chip
Pearson.

If you want to use them, post back and I can show how to add them to the
right-click menu or you could just add them to a couple of buttons on your
Toolbar.

Sub UnSelectActiveCell()
Dim Rng As Range
Dim FullRange As Range
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()
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 Excel MVP


On Sun, 3 Jul 2005 03:55:01 -0700, "Gallant"
wrote:

I have to Question regarding selecting and deselecting rows,columns,... in
Excel.

1-When some row or cells are selected how we can we just deselect one row
or cell or column?We usually do it by keeping the Ctrl key in other office
program.

2-Is there any way that we can use to select raws or columns one in
between?It could be very useful.

Regards

Gallant