Thread: Add Sort button
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Manville Bill Manville is offline
external usenet poster
 
Posts: 473
Default Add Sort button

Mike wrote:
A/ Can I add a button to a cell in my worksheet that will
sort the column data? Like the Assending/Descending
buttons on the toolbar above the sheet. Basically, can I
add those buttons to a cell?


Well, you can't add toolbar buttons as such to a cell.
But you can copy the images from the toolbar buttons and paste them
into the cells.
View / Toolbars / Customize / Right-click a Sort toolbar button / Copy
button image
Select the cell
Edit / Paste

Then you could assign a macro to the picture, something like this:

Sub SortDataAscending()
Dim R As Range
' find where the calling button is
R = ActiveSheet.Pictures(Application.Caller).TopLeftCe ll
R.CurrentRegion.Sort key1:=R, Order1:=xlAscending, Header:=xlYes
End Sub

You could then copy the picture to other cells to sort by the relevant
columns.

B/ Can I have Excel mail me when a date within the
worksheet is getting close, or overdue, etc..?

Maybe.
Excel would need to be running with the workbook open to be able to do
it (could be as a result of a scheduled task when you are not present).
Then you would need a macro to check the dates for
closeness/overdueness.

The macro could send an email by various means. See
http://www.rondebruin.nl/sendmail.htm

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup