#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Auto Sorting

Good Afternoon,

I have a question for all you excel experts out there! I am making a
spreadsheet for my staff to use with all the clients they are calling. I
would like to be able to have the spreadsheet auto sort alphabetically by the
name of the person entering in the information. Example:

A1 B1 C1
Row 4 Name Date Time
Row 5 Mark 03-03 1:30pm
Row 6 John 03-03 12:30pm

So when the name is entered Mark would drop to row 6 along with the other
information and john would move up to row 5 with that information as well.
The actual spreadsheet has 6 columns and would have rows 5 - 37 where the
user would enter information.

Thank you


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Auto Sorting

Hi

Copy the code below into the relevant Sheet code module.
Right click on the sheet tab
Paste code into white pane
Alt+F11 to return to Excel

Private Sub Worksheet_Change(ByVal Target As Range)

Dim myRange As Range, lr As Long
lr = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Set myRange = Range("F5:F37")

If Not Intersect(Target, myRange) Is Nothing Then
Application.EnableEvents = False
Range("A4:F37").Select
Selection.Sort Key1:=Range("A5"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A" & lr + 1).Select


End If
Application.EnableEvents = True

End Sub


--
Regards
Roger Govier

"RJ Swain" wrote in message
...
Good Afternoon,

I have a question for all you excel experts out there! I am making a
spreadsheet for my staff to use with all the clients they are calling. I
would like to be able to have the spreadsheet auto sort alphabetically by
the
name of the person entering in the information. Example:

A1 B1 C1
Row 4 Name Date Time
Row 5 Mark 03-03 1:30pm
Row 6 John 03-03 12:30pm

So when the name is entered Mark would drop to row 6 along with the other
information and john would move up to row 5 with that information as well.
The actual spreadsheet has 6 columns and would have rows 5 - 37 where the
user would enter information.

Thank you


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Auto Sorting

Thank you but I seem to be getting an error:

Run-time error 1004 This operation requires the merged cells to be
identically sized.

So, am I to assume any merged cells I have make them all the same size?

"Roger Govier" wrote:

Hi

Copy the code below into the relevant Sheet code module.
Right click on the sheet tab
Paste code into white pane
Alt+F11 to return to Excel

Private Sub Worksheet_Change(ByVal Target As Range)

Dim myRange As Range, lr As Long
lr = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Set myRange = Range("F5:F37")

If Not Intersect(Target, myRange) Is Nothing Then
Application.EnableEvents = False
Range("A4:F37").Select
Selection.Sort Key1:=Range("A5"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A" & lr + 1).Select


End If
Application.EnableEvents = True

End Sub


--
Regards
Roger Govier

"RJ Swain" wrote in message
...
Good Afternoon,

I have a question for all you excel experts out there! I am making a
spreadsheet for my staff to use with all the clients they are calling. I
would like to be able to have the spreadsheet auto sort alphabetically by
the
name of the person entering in the information. Example:

A1 B1 C1
Row 4 Name Date Time
Row 5 Mark 03-03 1:30pm
Row 6 John 03-03 12:30pm

So when the name is entered Mark would drop to row 6 along with the other
information and john would move up to row 5 with that information as well.
The actual spreadsheet has 6 columns and would have rows 5 - 37 where the
user would enter information.

Thank you


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Auto Sorting

Actually, it appears that it is not auto sorting the names, am I missing
something?

"RJ Swain" wrote:

Good Afternoon,

I have a question for all you excel experts out there! I am making a
spreadsheet for my staff to use with all the clients they are calling. I
would like to be able to have the spreadsheet auto sort alphabetically by the
name of the person entering in the information. Example:

A1 B1 C1
Row 4 Name Date Time
Row 5 Mark 03-03 1:30pm
Row 6 John 03-03 12:30pm

So when the name is entered Mark would drop to row 6 along with the other
information and john would move up to row 5 with that information as well.
The actual spreadsheet has 6 columns and would have rows 5 - 37 where the
user would enter information.

Thank you


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Auto Sorting

Hi

Merged cells are a real PIA. They cause all sorts of problems including the
one you have found.
Get rid of all Merged cells.
Use FormatCellsAlignmentCentre across selection instead, if you are
trying to have text above a number of col in your header

--
Regards
Roger Govier

"RJ Swain" wrote in message
...
Thank you but I seem to be getting an error:

Run-time error 1004 This operation requires the merged cells to be
identically sized.

So, am I to assume any merged cells I have make them all the same size?

"Roger Govier" wrote:

Hi

Copy the code below into the relevant Sheet code module.
Right click on the sheet tab
Paste code into white pane
Alt+F11 to return to Excel

Private Sub Worksheet_Change(ByVal Target As Range)

Dim myRange As Range, lr As Long
lr = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Set myRange = Range("F5:F37")

If Not Intersect(Target, myRange) Is Nothing Then
Application.EnableEvents = False
Range("A4:F37").Select
Selection.Sort Key1:=Range("A5"), Order1:=xlAscending, Header:=xlYes,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A" & lr + 1).Select


End If
Application.EnableEvents = True

End Sub


--
Regards
Roger Govier

"RJ Swain" wrote in message
...
Good Afternoon,

I have a question for all you excel experts out there! I am making a
spreadsheet for my staff to use with all the clients they are calling.
I
would like to be able to have the spreadsheet auto sort alphabetically
by
the
name of the person entering in the information. Example:

A1 B1 C1
Row 4 Name Date Time
Row 5 Mark 03-03 1:30pm
Row 6 John 03-03 12:30pm

So when the name is entered Mark would drop to row 6 along with the
other
information and john would move up to row 5 with that information as
well.
The actual spreadsheet has 6 columns and would have rows 5 - 37 where
the
user would enter information.

Thank you


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
auto sorting help needed thank you! Vicki Excel Worksheet Functions 2 November 20th 07 11:16 PM
Auto sorting Freshman Excel Worksheet Functions 2 November 16th 06 04:00 AM
Auto sorting Help please Larry Excel Worksheet Functions 0 August 1st 06 01:41 PM
Custom auto-sorting...possible? Pools New Users to Excel 4 July 3rd 06 06:03 AM
Auto Sorting Freshman Excel Worksheet Functions 5 August 31st 05 02:09 AM


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