![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 14
|
I have a data table that automatically opens with excel. What I am trying to do is when the user is finished entering thier data into the table and clicks on the close button it will automatically run that macro that I have already developed that sorts the data into the person's individual sheet and compiles that data into a group sheet.
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
You want to use the "BeforeClose" event: stick this on the "ThisWorkbook" object:
Private Sub Workbook_BeforeClose(Cancel As Boolean) Where "YourMacroName" is the name of your macro. HTH |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 14
|
Mark,
I have been trying a few different things with the code you gave me, it seems that it only works when I close the file out and not when I close the data form....What could I be missing here? |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|