+ Reply to Thread
Results 1 to 7 of 7

macro to remind doing some task before exiting file.

  1. #1
    Registered User
    Join Date
    01-13-2005
    Posts
    23

    macro to remind doing some task before exiting file.

    Often I work on file with unhidden sheets. Then sometimes I send it to my coworkers without hiding them again. I don’t want my coworkers to see them. I have already macro (hide_sheets) to hide these sheets, what I want is only reminder like msgbox yes/no before I exit file. If NO call “hide_sheets” ,if YES close a file. Reminder working together with Save As or Exit button. I am researching internet but no luck. Could you help please?

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Krzys, welcome to the forum.

    This might serve as a template for calling your routine. This belongs in the ThisWorkbook code module.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-13-2005
    Posts
    23
    Mike, thanks a lot for your help. It works like charm. I was pulling out all my hair.
    But I have another question that just came up.
    I use userform to input some values. When I reopen file and want to use this particular userform, the values are not shown. Can it be done that current values will be shown on this userform whenever I open it?
    Tanks

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Krzys
    In future please ask separate questions in new posts!

    Instead of a reminder, why not simply run your code to hide the sheets automatically before closing the workbook?

    As to the userform, all entries are removed when the form is closed. The only way to have them available on initialising is to store them in a sheet & load them back each time.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    01-13-2005
    Posts
    23
    Sorry Roy for not opening new treat. Yes, I have values saved on sheet, but I want userform to read them back so I can see what changes I have to make. The sheet I store all values from userform is one of the hidden sheets.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You can easily make the userform read the data even from a hidden sheet, eg

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-13-2005
    Posts
    23
    Ruy , thanks very much for your help. Works perfectly.

+ 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