Hi,
I want to check the column if it is sort ascendingly, if not, then will sort
it
How can I translate below into VBA code ?
If Column A is not sort ascendingly from A2 onward then
sort column A ascendingly from A2 onward
else
do something here.
Thanks.
Regards,
Magix
Dave Peterson - 13 Dec 2005 13:49 GMT
I wouldn't bother checking--just sort the range the way you want it.
I think that it would be easier/quicker than checking (and then possibly having
to sort).
> Hi,
>
[quoted text clipped - 11 lines]
> Regards,
> Magix

Signature
Dave Peterson
magix - 13 Dec 2005 14:00 GMT
Ok. I would just sort it.
What is the appropriate code ?
Worksheets("Sheet1").Range("A2").Sort
Key1:=Worksheets("Sheet1").Columns("A"), Header:=xlGuess ? How to set for
ascending order ?
> I wouldn't bother checking--just sort the range the way you want it.
>
[quoted text clipped - 16 lines]
> > Regards,
> > Magix
Dave Peterson - 13 Dec 2005 14:12 GMT
Record a macro when you select the range and sort the data based on the field
you want (in ascending order).
The recorded code will work nicely.
> Ok. I would just sort it.
>
[quoted text clipped - 29 lines]
> >
> > Dave Peterson

Signature
Dave Peterson