Add Sort button

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I have two questions:

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?

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

Thank you for your assistance. I've researched both of
these in other places, and found the answer to be no to
both questions, but I figured I'd ask the experts to get
the final answer.

Mike
 
Mike said:
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).TopLeftCell
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
 
the answer to B/ is yes:

ActiveWorkbook.SendMail _
Recipients:="(e-mail address removed)", _
Subject:="Date Is Over Due"

I'mm looking for an answer to A/
 
Back
Top