ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add Sort button (https://www.excelbanter.com/excel-programming/285584-add-sort-button.html)

mike

Add Sort button
 
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

Bill Manville

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


No Name

Add Sort button
 
the answer to B/ is yes:

ActiveWorkbook.SendMail _
", _
Subject:="Date Is Over Due"

I'mm looking for an answer to A/

-----Original Message-----
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
.



All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com