Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How can I lock the header cell so it's not alphabetized?

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!!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default How can I lock the header cell so it's not alphabetized?

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!!!!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How can I lock the header cell so it's not alphabetized?

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!!!!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default How can I lock the header cell so it's not alphabetized?

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
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.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default How can I lock the header cell so it's not alphabetized?

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
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
how do i lock a sort, ie no header row sotydor Excel Discussion (Misc queries) 1 December 3rd 07 04:40 AM
I need to lock pivot table header row height summervi Excel Discussion (Misc queries) 2 July 25th 07 10:38 PM
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 2 January 21st 07 10:59 PM
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 1 January 21st 07 09:44 AM
Lock Header Rows from Editing HotRod Excel Programming 7 November 11th 05 04:29 PM


All times are GMT +1. The time now is 08:11 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"