LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 303
Default sorting without changing formats

3 options..

enter the names on a clean unshaded sheet
do the sort
copy the names and
go to a sheet with the shaded lines
and edit... paste special... values

or
have a list of pupils on a shaded lines sheet in alphabetical order
just mark cells next to the names

or
use a macro to do the sort and re- shade the lines after the sort

Sub ShadeEveryOtherRow()
Dim Counter As Integer

Sheets("sheet4").Select
Range("A1:M40").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Range("A1").Select

For Counter = 1 To 40
'If the row is an odd number (within the selection)...
If Counter Mod 2 = 1 Then
'Set the pattern to xlGray16.
Rows(Counter).Interior.Pattern = xlGray16

Else
Rows(Counter).Interior.Pattern = nil
End If
Next

End Sub

You will have to adjust the ranges to suit.
--
Greetings from New Zealand

"LisaD" wrote in message
...
I am creating a spreadsheet similar to a school attendance record so I have
a
white row and then a gray row. When I enter the children's names and run a
sort to put them in alphabetical order, it also sorts the cell format. Is
there anyway to make the form permanent and just the data sortable?





 
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
Changing number formats without rebuilding worksheet Joe Excel Discussion (Misc queries) 2 January 17th 07 04:54 PM
Changing date formats? lakegoddess Excel Discussion (Misc queries) 5 January 6th 06 05:26 PM
Changing Imported Date Formats Craig Lloyd Excel Worksheet Functions 5 December 20th 05 02:30 PM
Changing Imported Date Formats Craig Lloyd Excel Worksheet Functions 0 December 20th 05 12:51 PM
Excel 2003 is changing my date formats nbalch Excel Worksheet Functions 4 January 26th 05 07:01 PM


All times are GMT +1. The time now is 04:25 AM.

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

About Us

"It's about Microsoft Excel"