Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Simple Request for help on basic sorting.


Simple Request for help on basic sorting.

Author
Message
Blueoni
Blueoni
Forum God
Forum God (321 reputation)Forum God (321 reputation)Forum God (321 reputation)Forum God (321 reputation)Forum God (321 reputation)Forum God (321 reputation)Forum God (321 reputation)Forum God (321 reputation)Forum God (321 reputation)

Group: Forum Members
Posts: 1, Visits: 1
Ok, I have a range of cells (B4:AD28) which I need to make a button to sort by Column B Value in Decending order.

Imagine the data is as follows:

 _________________________________________________
|_____|__B__|__C__|__D__|__etc__|__AB_|__AC_|__AD_|
|__4__|  12   DAN  
|__5__|  15   BEN
|__6__|  7    BOB
|_etc_|  22   TOM
|__26_|  14   MAX
|__27_| 
|__28_|

Now here's the part that gets me stuck as I have almost no experience with Visual Basic...  I can select the cells with the mouse and go DATA->SORT from the menu bar, then make sure Column B is the first "Sort By" field and that Descending is selected and click ok.  Works like a charm.  I just want to place a button on the excel spreadsheet that does that everytime so that it is a single click process.

I have tried using the Sort command but have not been able to get it working or understand the error code enough to pinpoint the problem.  Hopefully this is a really easy one for someone and I have provided a bit of light Newbie entertainment BigGrin   Thanks.

ertaban
ertaban
Forum God
Forum God (835 reputation)Forum God (835 reputation)Forum God (835 reputation)Forum God (835 reputation)Forum God (835 reputation)Forum God (835 reputation)Forum God (835 reputation)Forum God (835 reputation)Forum God (835 reputation)

Group: Forum Members
Posts: 3, Visits: 9
you can record a macro from the tools menu

then insert a button

and eventually assign the button to the macro you've created

GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search