+ Reply to Thread
Results 1 to 2 of 2

[Fwd: Run macro on exit worksheet/workbook]

  1. #1
    toontje
    Guest

    [Fwd: Run macro on exit worksheet/workbook]



    -------- Original Message --------
    Subject: Run macro on exit worksheet/workbook
    Date: Tue, 02 Aug 2005 22:47:57 +0200
    From: toontje
    Organization: Versatel Nederland B.V.
    Newsgroups: microsoft.public.excel.worksheet.functions

    I am looking for a macro that opens a msgbox when exit the workbook to
    remind you
    like "you fill in your working hours?"

    is that Private Sub AutoClose() ?

    and where do i put it?

  2. #2
    Bob Umlas
    Guest

    Re: Run macro on exit worksheet/workbook]

    Right-Click on the Excel LOGO near the file menu, select View Code, and
    select Workbook from the left dropdown (which says "General", and select
    BeforeClose from the right-dropdown. You will see:
    Private Sub Workbook_BeforeClose(Cancel As Boolean)

    End Sub

    and you can put your code in there, something like:
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    if Msgbox("You Fill in your working hours?",vbyesno+vbquestion)=vbno
    then cancel=true
    End Sub


    Bob Umlas
    Excel MVP

    "toontje" <abreijer1@zonnet.nl> wrote in message
    news:dc46d$42f286d7$3e3ba125$30190@news.versatel.nl...
    >
    >
    > -------- Original Message --------
    > Subject: Run macro on exit worksheet/workbook
    > Date: Tue, 02 Aug 2005 22:47:57 +0200
    > From: toontje
    > Organization: Versatel Nederland B.V.
    > Newsgroups: microsoft.public.excel.worksheet.functions
    >
    > I am looking for a macro that opens a msgbox when exit the workbook to
    > remind you
    > like "you fill in your working hours?"
    >
    > is that Private Sub AutoClose() ?
    >
    > and where do i put it?




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1