+ Reply to Thread
Results 1 to 4 of 4

Deselecting unwanted cells

  1. #1
    Octavio
    Guest

    Deselecting unwanted cells

    Once you select a group of cells, how do you deselect from that previously
    selected group one cell or a few unwanted cells without deselecting the rest
    of the group?



  2. #2
    Paul B
    Guest

    Re: Deselecting unwanted cells

    Octavio, here is a post by Chip Pearson on the subject,

    I long ago got tired of the situation you describe, and wrote two
    procedures to deal with it. The first, UnSelectActiveCell removes
    the active cell from the selection. The second, UnSelectActiveArea,
    removes an entire area from the selection. Attach these procedures
    to your right-click menu and you'll be all set.


    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(ActiveCeÂ*ll, 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
    '-----------------------------Â*--


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com [email protected]


    --
    Paul B
    Always backup your data before trying something new
    Please post any response to the newsgroups so others can benefit from it
    Feedback on answers is always appreciated!
    Using Excel 2002 & 2003

    "Octavio" <[email protected]> wrote in message
    news:[email protected]...
    > Once you select a group of cells, how do you deselect from that previously
    > selected group one cell or a few unwanted cells without deselecting the

    rest
    > of the group?
    >
    >




  3. #3
    Octavio
    Guest

    Re: Deselecting unwanted cells

    This seems very sophisticated and complicated for novices. Dones not excell
    has a tool or a built in command to do this?


    "Paul B" <[email protected]> wrote in message
    news:[email protected]...
    > Octavio, here is a post by Chip Pearson on the subject,
    >
    > I long ago got tired of the situation you describe, and wrote two
    > procedures to deal with it. The first, UnSelectActiveCell removes
    > the active cell from the selection. The second, UnSelectActiveArea,
    > removes an entire area from the selection. Attach these procedures
    > to your right-click menu and you'll be all set.
    >
    >
    > 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(ActiveCeÂ*ll, 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
    > '-----------------------------Â*--
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com [email protected]
    >
    >
    > --
    > Paul B
    > Always backup your data before trying something new
    > Please post any response to the newsgroups so others can benefit from it
    > Feedback on answers is always appreciated!
    > Using Excel 2002 & 2003
    >
    > "Octavio" <[email protected]> wrote in message
    > news:[email protected]...
    >> Once you select a group of cells, how do you deselect from that
    >> previously
    >> selected group one cell or a few unwanted cells without deselecting the

    > rest
    >> of the group?
    >>
    >>

    >
    >




  4. #4
    Paul B
    Guest

    Re: Deselecting unwanted cells

    Octavio, not that I am aware of,

    To put in this macro, from your workbook right-click the workbook's icon and
    pick View Code. This icon is to the left of the "File" menu this will open
    the VBA editor, in the left hand window click on your workbook name, go to
    insert, module, and paste the code in the window that opens on the right
    hand side, press Alt and Q to close this window and go back to your workbook
    and press alt and F8, this will bring up a box to pick the Macro from, click
    on the Macro name to run it. If you are using excel 2000 or newer you may
    have to change the macro security settings to get the macro to run. To
    change the security settings go to tools, macro, security, security level
    and set it to medium.


    You may also what to have a look here on getting started with macros
    http://www.mvps.org/dmcritchie/excel/getstarted.htm


    --
    Paul B
    Always backup your data before trying something new
    Please post any response to the newsgroups so others can benefit from it
    Feedback on answers is always appreciated!
    Using Excel 2002 & 2003

    "Octavio" <[email protected]> wrote in message
    news:uTzWw%[email protected]...
    > This seems very sophisticated and complicated for novices. Dones not

    excell
    > has a tool or a built in command to do this?
    >
    >
    > "Paul B" <[email protected]> wrote in message
    > news:[email protected]...
    > > Octavio, here is a post by Chip Pearson on the subject,
    > >
    > > I long ago got tired of the situation you describe, and wrote two
    > > procedures to deal with it. The first, UnSelectActiveCell removes
    > > the active cell from the selection. The second, UnSelectActiveArea,
    > > removes an entire area from the selection. Attach these procedures
    > > to your right-click menu and you'll be all set.
    > >
    > >
    > > 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(ActiveCeÂ*ll, 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
    > > '-----------------------------Â*--
    > >
    > >
    > > --
    > > Cordially,
    > > Chip Pearson
    > > Microsoft MVP - Excel
    > > Pearson Software Consulting, LLC
    > > www.cpearson.com [email protected]
    > >
    > >
    > > --
    > > Paul B
    > > Always backup your data before trying something new
    > > Please post any response to the newsgroups so others can benefit from it
    > > Feedback on answers is always appreciated!
    > > Using Excel 2002 & 2003
    > >
    > > "Octavio" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> Once you select a group of cells, how do you deselect from that
    > >> previously
    > >> selected group one cell or a few unwanted cells without deselecting the

    > > rest
    > >> of the group?
    > >>
    > >>

    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1