Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 10-02-2010, 08:22 AM
BjornS BjornS is offline Macro for automatic sorting Windows Vista Macro for automatic sorting Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default

Hi,
I am more a "formula expert", but I looked around a little, stole some code and modified it

Here we go:
Right click the sheet tab. Select "View code".
Paste the code below. Modify sort column if wanted (A1 at the moment). Leave with Alt+Q.
Done!

Kind regards
Bjorn

Private Sub Worksheet_Change(ByVal Target As Range)
'Sort this sheet by column A
'Written by OzGrid Business Applications
'www.ozgrid.com
'small modification by Bjorn 2010-10-02

On Error Resume Next
Application.EnableEvents = False
Me.UsedRange.Sort _
Key1:=[A1], Order1:=xlAscending, Header:=xlYes, Orientation:=xlSortColumns
Application.EnableEvents = True
On Error GoTo 0

End Sub
Reply With Quote
 

Tags
macro, sort



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for automatic sorting Sorting question markg2 Excel 4 01-25-2010 03:13 PM
automatic start of macro + help on writing helper function vsempoux Word 3 10-09-2009 03:01 AM
Sorting Outlook TO: field anakeimai Outlook 0 09-30-2009 06:15 AM
Sorting Tasks by Contacts Bat Outlook 0 09-24-2007 01:20 PM
sheet linking, sorting nickbfe Excel 0 05-19-2006 11:00 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft