Thread
:
Repeat job
View Single Post
#
5
Posted to microsoft.public.excel.programming
Norman Harker
external usenet poster
Posts: 162
Repeat job
Hi Bob!
I think the problem was that I didn't make a change to the Heading
setting when I recorded the sort. If I had, then the setting would
have been recorded. The other was possibly that I was using several
sorting routines. It was difficult to track why and when it guessed
wrong although I now suspect it was because I had data in the next but
one row above.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
"Bob Phillips" wrote in message
...
Hi Norman,
Can't say I have experienced this problem myself. I rarely leave a
recorded
macro as it is, I usually change it, that being one of the obvious
changes,
making the range dynamic being another, but xlGuess has not caused
me
problems that I recall.
That being said, I would agree with you that as selecting the Header
option
in the Sort dialog sets this to xlYes, changing it to xlNo is a wise
move. I
wonder why there is such an option? I could understand allowing one
to
manually code that option, but when you use the dialog you have to
specify
one or the other. Just MS I guess.
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"Norman Harker" wrote in message
...
Hi Bob!
A minor point that can cause wailing and gnashing of teeth. I
played
with auto recording sorting the other day and wasn't impressed.
The line that caused the problem was:
Selection.Sort Key1:=Range("C5"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
I got variable results from sorting (I had quite a few different
sorts) caused by the xlGuess.
As usual with recording it is necessary to look through the code
and
in this case the approach necessary was to change xlGuess to xlNo.
If
the data does include the headings then xlYes is needed.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
Excel and Word Function Lists (Classifications, Syntax and
Arguments)
available free to good homes.
"Bob Phillips" wrote in
message
...
Jim my,
As it seems a static sort, just record a macro to do it
(ToolsMacroRecord
Macro)
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"Jw" wrote in message
...
Hi, everyone
I daily used Excel 97 to sort the data by ascending from
A5:Z99 by
J5
(Delivery Date), how to write this code.
Thanks
Jimmy
Reply With Quote
Norman Harker
View Public Profile
Find all posts by Norman Harker