Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default Auto sorting Help please

Hi all,
I have a workbook with two sheets, one is my Lists sheet the other is my
Input sheet with a dynamic drop down. I found this code online but need some
help with it. everything I try breaks it.
the lists sheet has the following code:

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Columns(1).Sort Key1:=Range("A1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom
End Sub


The Input (data validation) sheet has the following code:

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim ws As Worksheet
Dim i As Integer

Set ws = Worksheets("Lists")
If Target.Column = 3 And Target.Row 1 Then
If Application.WorksheetFunction.CountIf(ws.Range("Na meList"),
Target.Value) Then
Exit Sub
Else
i = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
ws.Range("A" & i).Value = Target.Value
ws.Range("NameList").Sort Key1:=ws.Range("A1"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End If

End Sub

The List on the list shedt is "NameList" and has the following source in
name define:
=OFFSET(Lists!$A$1,0,0,COUNTA(Lists!$A:$A),1)

What I need to do is break the Ascending sort without breaking the
functionality.\
I would like the drop down to remain dynamic but when a new entry is added
it goes to the last empty cell not a sorted cell.

Can someone help?? thanks, larry
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
Running auto correct on startup? Mitch Excel Discussion (Misc queries) 1 November 28th 05 06:38 PM
How to AUTO SORT A-Z new data in a column (not menual sorting) Nir Excel Worksheet Functions 2 November 8th 05 10:29 PM
Auto Sorting Freshman Excel Worksheet Functions 5 August 31st 05 02:09 AM
Auto sorting a table JOHN ROBERTS Charts and Charting in Excel 1 August 30th 05 03:16 AM
excel links update not working in auto, calculations in auto Mikey Boy Excel Worksheet Functions 0 December 7th 04 11:53 PM


All times are GMT +1. The time now is 02:43 AM.

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"