Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 788
Default Automatically Sort Alphabetically

Hi All,

I have a spreadsheet with 6 columns of data.
In column "C" contains the name of the person, A, B, D, E, and F contain
other information.

I would like to keep the users name in column C.

Is it possible to set somthing up where at the end of the spreadsheet if I
add a new entry that it will automatically place that person alphabetically?

Any helps would be great.
Thanks,

Chris
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Automatically Sort Alphabetically

Chris,

Right click your sheet tab, view code and paste the code below in. On
entering data in column C you will be asked if your want to sort. If Yes then
columns A - F will be sorted on column C

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("C:C")) Is Nothing Then
response = MsgBox("Do you want to sort", vbYesNo)
If response = vbNo Then Exit Sub
Lastrow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A1:F" & Lastrow).Sort Key1:=Range("C1"), Order1:=xlAscending
End If
End Sub

Mike

"Chris" wrote:

Hi All,

I have a spreadsheet with 6 columns of data.
In column "C" contains the name of the person, A, B, D, E, and F contain
other information.

I would like to keep the users name in column C.

Is it possible to set somthing up where at the end of the spreadsheet if I
add a new entry that it will automatically place that person alphabetically?

Any helps would be great.
Thanks,

Chris

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 788
Default Automatically Sort Alphabetically

Hi Mike, thanks thats great!

only one problem..

That is when i sort the top section accross a1 b1 c1 etc.. is where i keep
the title of each coloum, like A1 says: Data. B1 says Number and C1 says
Name..

When i sort the titles of each colum sort as well so it wnd up like this..

Permanet 3 Abby
Permanet 4 Chris
Data Number Name


any way of fixing the titles to the top of the sheet?

thanks for your help



"Mike H" wrote:

Chris,

Right click your sheet tab, view code and paste the code below in. On
entering data in column C you will be asked if your want to sort. If Yes then
columns A - F will be sorted on column C

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("C:C")) Is Nothing Then
response = MsgBox("Do you want to sort", vbYesNo)
If response = vbNo Then Exit Sub
Lastrow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A1:F" & Lastrow).Sort Key1:=Range("C1"), Order1:=xlAscending
End If
End Sub

Mike

"Chris" wrote:

Hi All,

I have a spreadsheet with 6 columns of data.
In column "C" contains the name of the person, A, B, D, E, and F contain
other information.

I would like to keep the users name in column C.

Is it possible to set somthing up where at the end of the spreadsheet if I
add a new entry that it will automatically place that person alphabetically?

Any helps would be great.
Thanks,

Chris

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 788
Default Automatically Sort Alphabetically

Ah, sloved it!

but ive just relisezd that i have a first and last name box.
How would i be able to include both boxes?

Obviously I want to keep everyones first and surname together, how is this
possible?

Thanks
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 sort A1 THROUGH F26 alphabetically? Meer Excel Discussion (Misc queries) 6 May 14th 08 03:58 AM
how to sort non-alphabetically Grd New Users to Excel 2 May 23rd 07 03:27 PM
How do I sort alphabetically in Excel seh60025 Excel Discussion (Misc queries) 1 October 26th 06 10:25 PM
How do I sort in Excel alphabetically? Jennifer Excel Discussion (Misc queries) 2 January 20th 06 04:42 PM
sort by alphabetically HOW CAN I SORT BY ALPHABETICALLY FROM A New Users to Excel 4 May 12th 05 05:44 AM


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