Mike, that should all be one line of code. The automatic line wrap in the
news reader screwed it up.
"Mike C" wrote:
> On Apr 13, 12:21 am, Per Jessen <perjesse...@hotmail.com> wrote:
> > On 13 Apr., 07:04, Mike C <js2k...@yahoo.com> wrote:
> >
> > > Hello - I am wondering if anyone could provide me with code that will
> > > re-sort a list, each time a user places a new line at the bottom of
> > > the list.
> >
> > > So, for example, in column A, rows 1-10, I have a list of names, which
> > > are sorted descending. When a new name is added to row 11, and the
> > > user clicks out off of the cell or presses enter, I am hoping the
> > > column can automatically resort.
> >
> > > Thanks for any suggestions.
> >
> > Hi Mike
> >
> > Place the code below in the code sheet of the sheet containing your
> > list.
> >
> > Private Sub Worksheet_Change(ByVal Target As Range)
> > Set isect = Intersect(Target, Range("A:A"))
> > If Not isect Is Nothing Then
> > Range("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending,
> > Header:=xlGuess, _
> > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
> > End If
> > End Sub
> >
> > Regards,
> > Per
>
> Thanks Jessen. For some reason, the section that reads:
>
> Range("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending,
> Header:=xlGuess, _
> OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
>
> is giving me an error (i.e., turning red, reading "expression error")
> as soon as I paste it into the worksheet's module.
>
> Is this possibly because i have excel 2003?
>
>
|