Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
assigning macro carrera Excel Discussion (Misc queries) 16 March 21st 08 09:00 PM
Problem assigning macro to menu button Robert Moore Excel Worksheet Functions 0 August 13th 07 08:26 AM
Problem Assigning Macros Rafe Excel Worksheet Functions 2 June 17th 05 06:40 PM
Problem assigning macro to button? ltickett Excel Programming 2 June 11th 04 02:57 PM
Problem with assigning values to items in collection Jurry[_12_] Excel Programming 0 May 12th 04 09:18 PM


All times are GMT +1. The time now is 07:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"