Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Applications / Excel / July 2007



Tip: Looking for answers? Try searching our database.

Deselecting specific row/cell/column from selected cells

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Skyline - 13 Jul 2007 03:20 GMT
I have a workbook I am working on for work.  I have to select everything and
then deselect ONLY the first row.  Is there anyway I can do this in Excel.  
I have to select everything 1.) because I am trying to macro most of the
work, and 2.) row one contains only headers I don't want in my sort/filter.

I thought the deselect was the same as select(ctl+click/drag or
shift+click/drag) but its not.

Can someone please help

Thanks,
CJ
CyberTaz - 13 Jul 2007 11:54 GMT
Well CJ, first of all a caption row shouldn't interfere with a sort or a
filter if they're done properly - In fact, both the AutoFilter & the
Advanced *require* that a header row be included in the data range.

Secondly - I am *not* the macro guy - but I don't see why the whole sheet
would have to be selected to run a macro. What could you be doing that has
to affect 16,776,960 cells at a time? There must be another, more efficient
way to accomplish what you're trying to do:)

Third, you can deselect just the first (or any bordering) row or column, but
the location of the active cell in the range is the key. If the Active Cell
is in the very last row of the selected range, Shift+Down Arrow will
deselect the top row in the range.

If you post back with details of what you're trying to do perhaps there may
be a few suggestions to be had.

Regards |:>)
Bob Jones
[MVP] Office:Mac

On 7/12/07 10:20 PM, in article
E9DDFB4D-89FD-4E0D-AFFE-2E9DA46CA25C@microsoft.com, "Skyline"

> I have a workbook I am working on for work.  I have to select everything and
> then deselect ONLY the first row.  Is there anyway I can do this in Excel.
[quoted text clipped - 8 lines]
> Thanks,
> CJ
JE McGimpsey - 15 Jul 2007 06:16 GMT
> I have a workbook I am working on for work.  I have to select everything and
> then deselect ONLY the first row.  Is there anyway I can do this in Excel.  
[quoted text clipped - 3 lines]
> I thought the deselect was the same as select(ctl+click/drag or
> shift+click/drag) but its not.

First, one can never "deselect" a cell. Instead, one makes a new
selection (that may contain fewer cells).

Second, if you're going to use macros, you should probably not use
selections at all. Using the range objects directly gives you shorter,
faster, and IMNSHO, easier to maintain code.

For instance, if you're selecting the cells in the region around A1
(say, A1:Jxxx), then "deselecting" row 1 (i.e, selecting A2:Jxxxx), you
could, instead of:

   Range("A1").CurrentRegion.Select
   Selection.Offset(1, 0).Resize( _
           Selection.Rows.Count - 1, Selection.Columns.Count).Select
   Selection.Sort _
               Key1:=Range("A2"), _
               Order1:=xlAscending, _
               Header:=xlGuess, _
               OrderCustom:=1, _
               MatchCase:=False, _
               Orientation:=xlTopToBottom

use the simpler

   Range("A1").CurrentRegion.Sort _
           Key1:=Range("A1"), _
           Order1:=xlAscending, _
           Header:=xlYes, _
           OrderCustom:=1, _
           MatchCase:=False, _
           Orentation:=xlTopToBottom
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.