Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Sorting hidden columns

How do I sort hidden columns, say columns B & C along with non-hidden columns
A & D?
Alex.W
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Sorting hidden columns

Simply make sure that the hidden columns are included in the selection that
you want to sort. I usually just click on the row identifier 1 at the left of
the sheet so that the entire row is highlighted and drag down to include all
rows to be sorted. Alternatively click on the row identifier 1 and then
scroll down to the last required row to be sorted and hold the shift key down
and then click on the last row.

Regards,

OssieMac

"Alex.W" wrote:

How do I sort hidden columns, say columns B & C along with non-hidden columns
A & D?
Alex.W

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Sorting hidden columns

Thanks OssieMac

I was of the understanding that hidden rows/columns did not sort with the
sort command. I have a macro that works fine when the columns are not hidden.
It does not work when columns are hidden.
Alex.W

"OssieMac" wrote:

Simply make sure that the hidden columns are included in the selection that
you want to sort. I usually just click on the row identifier 1 at the left of
the sheet so that the entire row is highlighted and drag down to include all
rows to be sorted. Alternatively click on the row identifier 1 and then
scroll down to the last required row to be sorted and hold the shift key down
and then click on the last row.

Regards,

OssieMac

"Alex.W" wrote:

How do I sort hidden columns, say columns B & C along with non-hidden columns
A & D?
Alex.W

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Sorting hidden columns

I tested my answer with hidden columns with both xl2002 and xl2007 in the
interactive mode and it certainly works there. I didn't test hidden rows.
However, can you post the macro code that does not work and if I can't answer
your query then someone else might.

Regards,

OssieMac

"Alex.W" wrote:

Thanks OssieMac

I was of the understanding that hidden rows/columns did not sort with the
sort command. I have a macro that works fine when the columns are not hidden.
It does not work when columns are hidden.
Alex.W

"OssieMac" wrote:

Simply make sure that the hidden columns are included in the selection that
you want to sort. I usually just click on the row identifier 1 at the left of
the sheet so that the entire row is highlighted and drag down to include all
rows to be sorted. Alternatively click on the row identifier 1 and then
scroll down to the last required row to be sorted and hold the shift key down
and then click on the last row.

Regards,

OssieMac

"Alex.W" wrote:

How do I sort hidden columns, say columns B & C along with non-hidden columns
A & D?
Alex.W

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Sorting hidden columns

Thanks again Ossiemac. Here is the code.

Range("E3:AP5003").AdvancedFilter Action:=xlFilterInPlace, Unique:=False
Application.Goto Reference:="SORT_RANGE"
Selection.Sort Key1:=Range("AL4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("D4").Select

Alex.W

"OssieMac" wrote:

I tested my answer with hidden columns with both xl2002 and xl2007 in the
interactive mode and it certainly works there. I didn't test hidden rows.
However, can you post the macro code that does not work and if I can't answer
your query then someone else might.

Regards,

OssieMac

"Alex.W" wrote:

Thanks OssieMac

I was of the understanding that hidden rows/columns did not sort with the
sort command. I have a macro that works fine when the columns are not hidden.
It does not work when columns are hidden.
Alex.W

"OssieMac" wrote:

Simply make sure that the hidden columns are included in the selection that
you want to sort. I usually just click on the row identifier 1 at the left of
the sheet so that the entire row is highlighted and drag down to include all
rows to be sorted. Alternatively click on the row identifier 1 and then
scroll down to the last required row to be sorted and hold the shift key down
and then click on the last row.

Regards,

OssieMac

"Alex.W" wrote:

How do I sort hidden columns, say columns B & C along with non-hidden columns
A & D?
Alex.W



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Sorting hidden columns

I can definitely sort hidden columns if the columns are included in the range
to be sorted. Hidden rows do not work.

Used the following code in both xl2002 and xl2007.

Sheets("Sheet1").Activate

'Insert a worksheet name for the range to be sorted
Range("E3:AP5003").Select
ActiveWorkbook.Names.Add Name:="SORT_RANGE", RefersToR1C1:=Selection

Range("SORT_RANGE").Select 'Goto also works

'I prefer to be specific with things like header = xlYes or xlNo.
'I don't like the xlGuess in macros. (I guess I don't trust it.)
'Note: Whether xlYes or xlNo, Sort Key is still first Data cell never the
'header cell.
Selection.Sort Key1:=Range("AL4"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, Visible:=True
Range("D4").Select

Regards,

OssieMac


"Alex.W" wrote:

Thanks again Ossiemac. Here is the code.

Range("E3:AP5003").AdvancedFilter Action:=xlFilterInPlace, Unique:=False
Application.Goto Reference:="SORT_RANGE"
Selection.Sort Key1:=Range("AL4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("D4").Select

Alex.W

"OssieMac" wrote:

I tested my answer with hidden columns with both xl2002 and xl2007 in the
interactive mode and it certainly works there. I didn't test hidden rows.
However, can you post the macro code that does not work and if I can't answer
your query then someone else might.

Regards,

OssieMac

"Alex.W" wrote:

Thanks OssieMac

I was of the understanding that hidden rows/columns did not sort with the
sort command. I have a macro that works fine when the columns are not hidden.
It does not work when columns are hidden.
Alex.W

"OssieMac" wrote:

Simply make sure that the hidden columns are included in the selection that
you want to sort. I usually just click on the row identifier 1 at the left of
the sheet so that the entire row is highlighted and drag down to include all
rows to be sorted. Alternatively click on the row identifier 1 and then
scroll down to the last required row to be sorted and hold the shift key down
and then click on the last row.

Regards,

OssieMac

"Alex.W" wrote:

How do I sort hidden columns, say columns B & C along with non-hidden columns
A & D?
Alex.W

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Sorting hidden columns

Thanks OssieMac, I will give it a try.
Alex.W

"OssieMac" wrote:

I can definitely sort hidden columns if the columns are included in the range
to be sorted. Hidden rows do not work.

Used the following code in both xl2002 and xl2007.

Sheets("Sheet1").Activate

'Insert a worksheet name for the range to be sorted
Range("E3:AP5003").Select
ActiveWorkbook.Names.Add Name:="SORT_RANGE", RefersToR1C1:=Selection

Range("SORT_RANGE").Select 'Goto also works

'I prefer to be specific with things like header = xlYes or xlNo.
'I don't like the xlGuess in macros. (I guess I don't trust it.)
'Note: Whether xlYes or xlNo, Sort Key is still first Data cell never the
'header cell.
Selection.Sort Key1:=Range("AL4"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, Visible:=True
Range("D4").Select

Regards,

OssieMac


"Alex.W" wrote:

Thanks again Ossiemac. Here is the code.

Range("E3:AP5003").AdvancedFilter Action:=xlFilterInPlace, Unique:=False
Application.Goto Reference:="SORT_RANGE"
Selection.Sort Key1:=Range("AL4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("D4").Select

Alex.W

"OssieMac" wrote:

I tested my answer with hidden columns with both xl2002 and xl2007 in the
interactive mode and it certainly works there. I didn't test hidden rows.
However, can you post the macro code that does not work and if I can't answer
your query then someone else might.

Regards,

OssieMac

"Alex.W" wrote:

Thanks OssieMac

I was of the understanding that hidden rows/columns did not sort with the
sort command. I have a macro that works fine when the columns are not hidden.
It does not work when columns are hidden.
Alex.W

"OssieMac" wrote:

Simply make sure that the hidden columns are included in the selection that
you want to sort. I usually just click on the row identifier 1 at the left of
the sheet so that the entire row is highlighted and drag down to include all
rows to be sorted. Alternatively click on the row identifier 1 and then
scroll down to the last required row to be sorted and hold the shift key down
and then click on the last row.

Regards,

OssieMac

"Alex.W" wrote:

How do I sort hidden columns, say columns B & C along with non-hidden columns
A & D?
Alex.W

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
can no longer insert new columns & unhide hidden columns em2 Excel Worksheet Functions 1 July 19th 07 03:18 AM
Sorting and Hidden Rows ihatetheredskins Excel Worksheet Functions 0 June 22nd 07 04:05 PM
Hidden Columns No Longer Hidden after Copying Worksheet? EV Nelson Excel Discussion (Misc queries) 1 December 6th 06 05:10 PM
Need to sum columns, excluding hidden columns. psill Excel Discussion (Misc queries) 7 October 13th 06 07:49 PM
How to keep hidden columns hidden using protection Dave Excel Discussion (Misc queries) 1 March 1st 06 02:20 AM


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