+ Reply to Thread
Results 1 to 4 of 4

How to stop Private sub Sheet change (located at Thisworkbook) working in worksheet 3

  1. #1
    Registered User
    Join Date
    11-27-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    66

    How to stop Private sub Sheet change (located at Thisworkbook) working in worksheet 3

    Hi,

    I have a workbook which contain private sub sheet change (located at Thisworkbook). I will like to stop using this private sub on specific worksheet (sheet3) and I don't know what is the method to make it happen.

    Please help

    BR
    KC

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: How to stop Private sub Sheet change (located at Thisworkbook) working in worksheet 3

    You can place this macro in a specific sheet so it will only be activated by a change to this sheet.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    02-19-2013
    Location
    Honolulu
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: How to stop Private sub Sheet change (located at Thisworkbook) working in worksheet 3

    If you wanted this event to continue working on every sheet except sheet3, you could leave the sub in the ThisWorkbook module and just test the sheet name before actually doing anything...

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-27-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: How to stop Private sub Sheet change (located at Thisworkbook) working in worksheet 3

    Hi rnamahoe,

    I find out that this code that you provide:
    PHP Code: 
    Private Sub Workbook_SheetChange(ByVal Sh As ObjectByVal Target As Range)
    If 
    Sh.Name <> Sheet3.Name Then
      
    'Do Something
    End If
    End Sub 
    need to change the sheet3.name to "sheet3"
    PHP Code: 
    Private Sub Workbook_SheetChange(ByVal Sh As ObjectByVal Target As Range)
    If 
    Sh.Name <> "sheet3" Then
      
    'Do Something
    End If
    End Sub 
    Thanks

    BR
    KC
    Last edited by alexnkc; 02-20-2013 at 09:34 PM. Reason: typo error (from ' to "")

+ 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