View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default How do you invert your selection of cells in excel?

I am assuming that you want to move to the right rather than to the left:

Sub movsel()
Set r1 = Selection
Set rf = Nothing
For Each r In r1
If rf Is Nothing Then
Set rf = r.Offset(0, 1)
Else
Set rf = Union(rf, r.Offset(0, 1))
End If
Next
rf.Select
End Sub

if you wanted to move to the left use Offset(0,-1) instead.
--
Gary's Student
gsnu200708


"Jon" wrote:

I have groups of cells scatered at differnt parts of the sheet (saying what
the cell next to it is) selected. How do in invert my selection so that
instade of the "title" cells being selected the "data" cells are? There is no
"invert selection" in the edit menu like there is for other programs.