LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jack Sons
 
Posts: n/a
Default code in module A to not execute a Worksheet_SelectionChange sub of another module

Hi all,

In the sheet module of sheet("totaal") I have a sub (see below between the
first two ---- lines) that gives me a certain button in the upper left
corner of sheet("totaal") when I scroll to the right to another part of that
large sheet.

In a regular code module I have a sub (see below the second --- line) that
switches to the Worksheet_SelectionChange sub when it arrives at the
autofilter part and in numerous other occasions of which the code lines are
not shown below. In principle it does no harm, but it takes a lot of time,
which is unnecessary.

How can I tell the second sub (the Lijst_klassen_schoonh_B sub) to ignore
the first (the Worksheet_SelectionChange sub)?

Jack Sons
The Netherlands

---------------------------------------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
If ActiveCell.Column 16 Then
Dim myShape As Shape
Set myShape = Me.Shapes("historie")
With Me.Cells(1, ActiveWindow.ScrollColumn)
myShape.Top = 30 '.Top
myShape.Left = .Left
End With
End If
End Sub
------------------------------------------------------------------------------

Sub Lijst_klassen_schoonh_B()
Application.ScreenUpdating = False
Sheets("totaal").Select
'Calculate
kolkol = ActiveCell.Column
rijrij = ActiveCell.Row

Sheets("SH00").Visible = True
Sheets("SN00").Visible = True
Sheets(Array("SH00", "SN00")).Select
Sheets("SH00").Activate
Cells.Select
Selection.ClearContents
With Selection.Font
.Name = "Times New Roman"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlNone
End With
Selection.Font.Bold = False

Selection.Borders(xlLeft).LineStyle = xlNone
Selection.Borders(xlRight).LineStyle = xlNone
Selection.Borders(xlTop).LineStyle = xlNone
Selection.Borders(xlBottom).LineStyle = xlNone
Selection.BorderAround LineStyle:=xlNone

Selection.RowHeight = 12
Range("A1").Select

Sheets("totaal").Select
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=18, Criteria1:="SHB???04???", _
Operator:=xlAnd
Selection.AutoFilter Field:=51, Criteria1:="="
Selection.AutoFilter Field:=52, Criteria1:="="
---------------------------------------------------------------------------------------------



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM
Change case...help please Terry Excel Worksheet Functions 14 October 2nd 05 12:29 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM


All times are GMT +1. The time now is 04:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"