Results 1 to 9 of 9

Getting Worksheet_Activate to only run when user clicks on the sheet (not at opening file)

Threaded View

  1. #1
    Registered User
    Join Date
    02-01-2011
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    9

    Getting Worksheet_Activate to only run when user clicks on the sheet (not at opening file)

    [SOLVED]

    Hi,

    I have a file with several sheets. One of them uses the Worksheet_Activate event. This sub sets Application_EnableEvents to False in the beginning and True at the end. The code works fine. It runs when the sheet is selected by the user.

    Now to my problem: When the workbook is opened the Worksheet_Activate code runs. I want the code to only run when the user actually clicks on the sheet.

    I have tried to find a way so that the Worksheet_Activate code does not run at opening. I read somewhere that Workbook_Activate does not run until the workbook has finished opening. I don't know if that is true or not but anyway I tried to disable events in Workbook_Open and then enable them again in Workbook_Activate. But no... The disabling works but it is not enabled again when the file has finished opening.

    And also: I am worried that I, by messing with events at opening, will mess up something that I am not aware of.

    I hope that my description is clear and that someone has a suggestion for how I can solve this.

    Thanks in advance.

    /Zenita
    Last edited by zenita; 03-16-2015 at 08:43 AM. Reason: Cannot find any other place to write [SOLVED]

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 06-22-2014, 04:18 PM
  2. Msgbox appear when user clicks save?
    By buckhunt122 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2011, 06:53 PM
  3. Replies: 12
    Last Post: 06-07-2011, 04:17 AM
  4. How to catch when the user clicks a cell?
    By WhiteEagle in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-26-2007, 10:17 AM
  5. Run a macro when a user clicks in a certain cell
    By NickySA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2007, 08:20 AM

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