LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Autosort multiple columns, Keep records intact.

I have code that autosorts ONE lookup column whenever a value is
entered.

What change would allow autosorting 3 columns of records but keep
everything ordered by the 1st column and not loose syncing of the
records?

This code perfectly sorts any values placed in col 13 OR 16 of some
lookup lists.

Private Sub Worksheet_Change(ByVal Target As Range)
'DD Define columns to autosort when record added or deleted
If Target.Column = 13 Or Target.Column = 16 Then
Columns(Target.Column).Sort _
Key1:=Cells(1, Target.Column), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom
End If
End Sub

I couldn't find a Class property that delt with the issue of sorting
multiple columns and keeping the records intact so I tried this code
change but it did nothing at all that I could see:

Private Sub Worksheet_Change(ByVal Target As Range)
'DD Define columns to autosort when record added or deleted
If Target.Column = 26 And Target.Column = 27 _
And Target.Column = 28 And Target.Column = 29 Then
Columns(Target.Column).Sort _
Key1:=Cells(1, Target.Column), Order1:=xlAscending, _
Header:=xlNo, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom
End If
End Sub


Thanks, Dennis

 
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
Sorting columns while keeping row data intact Paul New Users to Excel 5 February 21st 07 04:41 PM
How to copy from Adobe with tables to Excel with columns intact Shengli Excel Discussion (Misc queries) 0 July 15th 06 06:56 AM
Sorting columns left to right leave a intact Todd Excel Programming 3 April 1st 04 11:16 PM
Merging 3 Columns in an Excel Spreadsheet (Keeping Data Intact)...? : VB : Excel Programming 2 August 16th 03 11:31 AM
Merging 3 Columns in an Excel Spreadsheet (Keeping Data Intact)...2nd Post : VB : Excel Programming 2 August 16th 03 09:39 AM


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