Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning Macro Problem
Hi, I'm trying to assign my macro to an action or event (I think I'
using the correct jargon). When my user goes in to delete a worksheet, I want to call m 'DeleteSheet' subroutine. So I would have something like: Private Sub Workbook_Activate() If ActiveWorkSheet.Delete then Call DeleteSheet End If End Sub Will this macro always run in the background or can I specify it to ru only when user tries to delete? Thanks -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning Macro Problem
There is no delete sheet event. If you want to trap the user deleting a
worksheet I'd suggest that you protect the workbook so that he cannot directly do a sheet delete, and then provide a macro, attached to a menu, toolbutton, etc., that does the delete. -- Jim Rech Excel MVP "mai " wrote in message ... | Hi, I'm trying to assign my macro to an action or event (I think I'm | using the correct jargon). | | When my user goes in to delete a worksheet, I want to call my | 'DeleteSheet' subroutine. | | So I would have something like: | | Private Sub Workbook_Activate() | | If ActiveWorkSheet.Delete then Call DeleteSheet | End If | | End Sub | | Will this macro always run in the background or can I specify it to run | only when user tries to delete? | | Thanks. | | | --- | Message posted from http://www.ExcelForum.com/ | |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning Macro Problem
And there's no way for me to hard code the delete sheet event?
--- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning Macro Problem
You mean create a new event that fires when a worksheet is delete? No, there's
no way to do this. On Thu, 2 Sep 2004 14:25:31 -0500, mai wrote: And there's no way for me to hard code the delete sheet event? --- Message posted from http://www.ExcelForum.com/ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning Macro Problem
Darn, I thought Excel could do EVERYTHING! Oh well. Thanks fo
responding! I really appreciate it -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
assigning macro | Excel Discussion (Misc queries) | |||
Problem assigning macro to menu button | Excel Worksheet Functions | |||
Problem Assigning Macros | Excel Worksheet Functions | |||
Problem assigning macro to button? | Excel Programming | |||
Problem with assigning values to items in collection | Excel Programming |