Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Octavio
 
Posts: n/a
Default 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   Report Post  
Paul B
 
Posts: n/a
Default

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


--
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" wrote in message
...
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   Report Post  
Octavio
 
Posts: n/a
Default

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


"Paul B" wrote in message
...
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


--
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" wrote in message
...
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   Report Post  
Paul B
 
Posts: n/a
Default

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" wrote in message
...
This seems very sophisticated and complicated for novices. Dones not

excell
has a tool or a built in command to do this?


"Paul B" wrote in message
...
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


--
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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help adding text values Texas-DC_271 Excel Worksheet Functions 7 January 16th 05 12:14 AM
Convert data type of cells to Text,Number,Date and Time Kevin Excel Worksheet Functions 1 December 31st 04 01:57 PM
To safety merge cells without data destroyed, and smart unmerge! Kevin Excel Discussion (Misc queries) 0 December 30th 04 08:17 AM
Heps to design Locked/Unlocked cells in protected worksheet Kevin Excel Discussion (Misc queries) 0 December 30th 04 08:09 AM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:55 AM


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"