Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sort and highlight

Status
Not open for further replies.

newbie3

Programmer
Jan 26, 2005
5
US
I'm trying to create a macro that will highlight and area and pull up the sort table that gives the options for the sort. I tried to record a macro to do that but the macro won't let me stop recording as soon as I pull up the sort table (table shown after clicking data and then sort). Any help would be appreciated - There may be a visual basic code to get the drop down sort menu
Thanks
 
Hi newbie3,

No, you can't record that. The command is:

[blue][tt] Application.Dialogs(xlDialogSort).Show[/tt][/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
TonyJollans - thanks, that worked great. What code would I use if I also want it to automatically include the header row when the sort box opens up -thanks
 
Hi newbie3,

Not intuitive! It is the 8th parameter, so either:

[blue][tt] Application.Dialogs(xlDialogSort).Show , , , , , , , True[/tt][/blue] if you have a header row

or

[blue][tt] Application.Dialogs(xlDialogSort).Show , , , , , , , False[/tt][/blue] if you don't

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top