Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2005

Tip: Looking for answers? Try searching our database.

Column Sort

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
magix - 13 Dec 2005 13:41 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.