Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 4
Smile Automatically sort alphabetically ignoring header

Hey everyone!

I am sure someone can help me on here. I found an amazing post on this website which really helped me with getting something to work with automatically alphabeticising a column, but something went wrong with the previous file - it corrupted during a migration - and now it won't work.

I'm trying to do the same thing again, but cannot find the post and I swear I have gone through hundreds of posts on this website and the code that I have tried each and every time isn't the same one I found before.

Here is what I would like to do:
* Alphabeticize column A on Excel, starting from A5 onwards
* When it sorts, it must keep the information on that row from columns A - G (so when say, row 10 moves up to row 8, it doesn't just move column A, it also moves columns B-G with it so the information is relevant).
* It automatically does this once something is entered into column A, and either enter is hit or another box is selected

I understand that once something is entered in column A and the data is sorted, it usually gets lost in the remainder of the spreadsheet but this was something we worked with in the past.

Also, please note that Column A (and up to G, with the exception of two columns) are all text based, not numeric. Not sure if this makes a difference.

Any help is much appreciated. Currently running on Office 2010. And this was the code I kept finding, but no matter how I amend it, it ALWAYS takes the first 4 rows instead of starting alphabetically from the fifth. Maybe someone could assist and let me know where I'm going wrong, so I can learn it instead of just being told?



Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns("A:A")) Is Nothing Then
Else
Application.EnableEvents = False
Columns("A:Z").Select
Selection.Sort Key1:=Range("A5"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=5, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Application.EnableEvents = True
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,522
Default Automatically sort alphabetically ignoring header

On Monday, October 15, 2012 10:48:47 AM UTC-5, EmzOLV wrote:
Hey everyone!



I am sure someone can help me on here. I found an amazing post on this

website which really helped me with getting something to work with

automatically alphabeticising a column, but something went wrong with

the previous file - it corrupted during a migration - and now it won't

work.



I'm trying to do the same thing again, but cannot find the post and I

swear I have gone through hundreds of posts on this website and the code

that I have tried each and every time isn't the same one I found before.





Here is what I would like to do:

* Alphabeticize column A on Excel, starting from A5 onwards

* When it sorts, it must keep the information on that row from columns A

- G (so when say, row 10 moves up to row 8, it doesn't just move column

A, it also moves columns B-G with it so the information is relevant).

* It automatically does this once something is entered into column A,

and either enter is hit or another box is selected



I understand that once something is entered in column A and the data is

sorted, it usually gets lost in the remainder of the spreadsheet but

this was something we worked with in the past.



Also, please note that Column A (and up to G, with the exception of two

columns) are all text based, not numeric. Not sure if this makes a

difference.



Any help is much appreciated. Currently running on Office 2010. And this

was the code I kept finding, but no matter how I amend it, it ALWAYS

takes the first 4 rows instead of starting alphabetically from the

fifth. Maybe someone could assist and let me know where I'm going wrong,

so I can learn it instead of just being told?







Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Columns("A:A")) Is Nothing Then

Else

Application.EnableEvents = False

Columns("A:Z").Select

Selection.Sort Key1:=Range("A5"), Order1:=xlAscending, Header:=xlGuess,

_

OrderCustom:=5, MatchCase:=False, Orientation:=xlTopToBottom, _

DataOption1:=xlSortNormal

Application.EnableEvents = True

End If

End Sub









--

EmzOLV


If you simply record a macro doing this, wihtout header, you will see how to modify your code.
  #3   Report Post  
Junior Member
 
Posts: 4
Smile

Quote:
Originally Posted by Don Guillett[_2_] View Post
If you simply record a macro doing this, wihtout header, you will see how to modify your code.
Oh my god, I totally forgot about that. I've got something to work with now. Thanks for stating the obvious :) very much appreciated!!!
Em
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
Automatically Sort Alphabetically Chris Excel Discussion (Misc queries) 3 November 25th 08 03:25 PM
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
sort by alphabetically HOW CAN I SORT BY ALPHABETICALLY FROM A New Users to Excel 4 May 12th 05 05:44 AM
How can I sort many items alphabetically, ignoring page breaks?? Kezza Macka Excel Worksheet Functions 1 April 11th 05 02:01 PM


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