PC Review


Reply
Thread Tools Rate Thread

Automatically Sort Alphabetically

 
 
Chris
Guest
Posts: n/a
 
      25th Nov 2008
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
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      25th Nov 2008
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

 
Reply With Quote
 
Chris
Guest
Posts: n/a
 
      25th Nov 2008
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

 
Reply With Quote
 
Chris
Guest
Posts: n/a
 
      25th Nov 2008
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesn't XP automatically/alphabetically sort files/folders? Pheasant PluckerŪ Windows XP General 2 31st Jul 2006 03:42 AM
Automatically sort files/icons alphabetically? Pheasant PluckerŪ Windows XP General 2 25th Jul 2006 10:39 AM
How do I sort Mac and Mc together alphabetically? =?Utf-8?B?cGVucm9k?= Microsoft Access Getting Started 9 27th Jun 2006 08:15 PM
How can I automatically sort my slides alphabetically by title? =?Utf-8?B?ZHlvdW5ncGxhbnRz?= Microsoft Powerpoint 3 1st Nov 2004 11:03 PM
sort alphabetically michaela Windows XP Internet Explorer 1 3rd Feb 2004 02:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:29 PM.