PC Review


Reply
Thread Tools Rate Thread

How can I lock the header cell so it's not alphabetized?

 
 
=?Utf-8?B?VGFuYU1hcnk=?=
Guest
Posts: n/a
 
      25th Sep 2007
I have a string (thanks to JW) to auto alphabetize column A in my
worksheet.... however...it's including the title cell. How can I adjust that
so it only alphabetizes from cell A2 through the rest of the worksheet.......

I SOOOOO need to take computer classes!!!!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWF0dGhldyBQZmx1Z2Vy?=
Guest
Posts: n/a
 
      25th Sep 2007
This line of code will sort the entire first column while leaving the header
row as it is.

Range("a:a").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlYes

This command will not affect data in adjacent columns. If you wish to sort
column a with other data, you should change the Range("a:a") part to
something that matches your range (like Range("a:e") or something).

HTH,
Matthew Pfluger

"TanaMary" wrote:

> I have a string (thanks to JW) to auto alphabetize column A in my
> worksheet.... however...it's including the title cell. How can I adjust that
> so it only alphabetizes from cell A2 through the rest of the worksheet.......
>
> I SOOOOO need to take computer classes!!!!

 
Reply With Quote
 
=?Utf-8?B?VGFuYU1hcnk=?=
Guest
Posts: n/a
 
      25th Sep 2007
Thanks Matthew. I also discovered there is a field in the General Tab under
Options that allows you to "ignore other applications" in specific cells.
That worked fine. Rather than mess with the string, I leave it at that.

BUT, I've copied your suggestion to keep with the original string for future
reference.

"Matthew Pfluger" wrote:

> This line of code will sort the entire first column while leaving the header
> row as it is.
>
> Range("a:a").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlYes
>
> This command will not affect data in adjacent columns. If you wish to sort
> column a with other data, you should change the Range("a:a") part to
> something that matches your range (like Range("a:e") or something).
>
> HTH,
> Matthew Pfluger
>
> "TanaMary" wrote:
>
> > I have a string (thanks to JW) to auto alphabetize column A in my
> > worksheet.... however...it's including the title cell. How can I adjust that
> > so it only alphabetizes from cell A2 through the rest of the worksheet.......
> >
> > I SOOOOO need to take computer classes!!!!

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      25th Sep 2007
This option does not ignore other applications in specific cells so I don't know
how that could possibly help you.

From help...............

In Excel, click Options on the Tools menu, and then click the General tab.
Clear the Ignore other applications check box.
If this option is selected, Excel ignores requests from programs that link to
Excel data by means of DDE rather than OLE.


Gord Dibben MS Excel MVP



On Tue, 25 Sep 2007 10:26:03 -0700, TanaMary
<(E-Mail Removed)> wrote:

>Thanks Matthew. I also discovered there is a field in the General Tab under
>Options that allows you to "ignore other applications" in specific cells.
>That worked fine. Rather than mess with the string, I leave it at that.


 
Reply With Quote
 
=?Utf-8?B?Q2FybG9z?=
Guest
Posts: n/a
 
      25th Sep 2007
Before sorting, you must be sure that the table is properly formatted. If,
for instance, you have something like:

Some Mexican Stocks
A Date
Mark CoTicker CoName PriceHi PriceLow
1 VTO Vitro 7 5
2 GELEF Elektra 15 6
3 TMX TELMEX 10 2

All attempts to sort the data will fail, because it is not clear which cells
form the table you want to sort. Although Excel functions have error-handlers
routines that can solve the error or ambiguity, it is better to state things
clearly. In your example, the error-handler is trying to solve the error by
including the title cell.

In my example, there must be an EMPTY row between the title of the table and
the data.

Some Mexican Stocks
A Date

Mark CoTicker CoName PriceHi PriceLow
1 VTO Vitro 7 5
2 GELEF Elektra 15 6
3 TMX TELMEX 10 2

As a general comment, I think it is better to state things clearly than
state them in a confusing way (either for others or for the machine), and
then fix them with another routine. By adding an extra routine or extra code
the whole task becomes more complex.
--
Carlos


"TanaMary" wrote:

> I have a string (thanks to JW) to auto alphabetize column A in my
> worksheet.... however...it's including the title cell. How can I adjust that
> so it only alphabetizes from cell A2 through the rest of the worksheet.......
>
> I SOOOOO need to take computer classes!!!!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How lock cell format, but not lock cell contents? Dave Peterson Microsoft Excel Worksheet Functions 2 10th Sep 2003 03:17 AM
How lock cell format, but not lock cell contents? Gavin Microsoft Excel Worksheet Functions 0 9th Sep 2003 09:35 AM
Lock Row as Header Steve Andrews Microsoft Excel Misc 1 10th Jul 2003 07:41 PM
Lock Row as Header PegL Microsoft Excel Misc 0 10th Jul 2003 07:40 PM
Lock Row as Header Wayne Microsoft Excel Misc 0 10th Jul 2003 07:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:01 PM.