Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Re : Excel FilterMode to Trigger WorkSheet_Calculate()

1. There are 2 worksheets (Sheet1 & Sheet2) in an Excel workbook.

2. The given worksheets are similar in that both of them contain
AutoFilters and make use of Event-Handlers such as WorkSheet_Calculate
().

3. On Sheet1, it enters into FilterMode after any one of the
AutoFilters is activated and consequently, WorkSheet-Calculate() is
Triggered.

4. On Sheet2, it enters into FilterMode after any one of the
AutoFilters is activated ; however, WorkSheet-Calculate() is NOT
Triggered.

5. The question is, Why is that difference between Sheet1 and Sheet2
with respect to Trigger & Non-Trigger of WorkSheet-Calculate() ?

6. Please share your experience.

7. Regards.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Re : Excel FilterMode to Trigger WorkSheet_Calculate()

I see 2 reasons.

1. Out of the below check where you have written your code.

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
'This Workbook event will be triggered for all sheets
End Sub

Private Sub Worksheet_Calculate()
'Each individual sheet has got its own Calculate event which will be
triggered only for that sheet
End Sub

2. Check the sheet reference used in your code. Check whether you have
specified ActiveSheet or Sheets(1) or ...

If this post helps click Yes
---------------
Jacob Skaria


" wrote:

1. There are 2 worksheets (Sheet1 & Sheet2) in an Excel workbook.

2. The given worksheets are similar in that both of them contain
AutoFilters and make use of Event-Handlers such as WorkSheet_Calculate
().

3. On Sheet1, it enters into FilterMode after any one of the
AutoFilters is activated and consequently, WorkSheet-Calculate() is
Triggered.

4. On Sheet2, it enters into FilterMode after any one of the
AutoFilters is activated ; however, WorkSheet-Calculate() is NOT
Triggered.

5. The question is, Why is that difference between Sheet1 and Sheet2
with respect to Trigger & Non-Trigger of WorkSheet-Calculate() ?

6. Please share your experience.

7. Regards.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Re : Excel FilterMode to Trigger WorkSheet_Calculate()

Jacob Skaria, Esq

Thank you very much indeed.

Have used ActiveSheet for the "Code-Behind" of Sheet1 & Sheet2.

As it turns out, Sheet2 does not execute the on-board "Code-Behind's
Worksheet_Calculate()" ; it makes use of Sheet1's "Code-Behind".
That's rather Odd indeed.

Have not made use of WorkBook's SheetCalculate().

Other lessons learned are that WorkSheet_Calculate()'s could execute
one after the other for the WorkSheets' Code-Behind.

WorkSheet_Calculate()'s can be rather difficult to handle.

Please continue discussion.

Regards.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Re : Excel FilterMode to Trigger WorkSheet_Calculate()

If you try a simple formula and calculate in all three sheets it calls the
corresponding WorkSheet_Calculate()

May be autofilter is not doing any calculations at all....instead use
Selection change or Change event. If you work with Workbook from sh object
you can get sh.name or sh.index which gives you the worksheet name or index
number


If this post helps click Yes
---------------
Jacob Skaria


" wrote:

Jacob Skaria, Esq

Thank you very much indeed.

Have used ActiveSheet for the "Code-Behind" of Sheet1 & Sheet2.

As it turns out, Sheet2 does not execute the on-board "Code-Behind's
Worksheet_Calculate()" ; it makes use of Sheet1's "Code-Behind".
That's rather Odd indeed.

Have not made use of WorkBook's SheetCalculate().

Other lessons learned are that WorkSheet_Calculate()'s could execute
one after the other for the WorkSheets' Code-Behind.

WorkSheet_Calculate()'s can be rather difficult to handle.

Please continue discussion.

Regards.

Reply
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
Re : Excel to by-pass Private Sub Worksheet_Calculate() [email protected] Excel Programming 4 March 3rd 09 08:54 AM
Re : Excel Worksheet_Calculate() & Worksheet_Change() [email protected] Excel Programming 0 March 3rd 08 09:31 AM
worksheet_calculate Libby Excel Programming 1 March 1st 08 03:45 PM
FilterMode does not work? Excel 2003/XML Fod Excel Programming 0 November 13th 07 01:16 PM
Worksheet_calculate() Alex Excel Programming 1 August 30th 05 10:09 PM


All times are GMT +1. The time now is 12:12 AM.

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"