Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a custom macro as below to count sheets in the current book:
Public Function CNTSH(Optional ByVal bIncludeChartSheets As Boolean = True) As Integer Call Application.Volatile(True) If bIncludeChartSheets = True Then CNTSH = Application.ActiveWorkbook.Sheets.Count Else CNTSH = Application.ActiveWorkbook.Worksheets.Count End If End Function Upon adding a new sheet the result doesn't change unless I press: F9; or F2 & Enter; Reenter the complete format. Why? Application.Volatile has been set to true? -- Best Regards, FARAZ A. QURESHI |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Inserting a sheet does not trigger a calculation. Deleting a sheet *does*
trigger a calculation. If the sheets are inserted with code, after you insert them add a line of code to calculate. -- Biff Microsoft Excel MVP "FARAZ QURESHI" wrote in message ... I have a custom macro as below to count sheets in the current book: Public Function CNTSH(Optional ByVal bIncludeChartSheets As Boolean = True) As Integer Call Application.Volatile(True) If bIncludeChartSheets = True Then CNTSH = Application.ActiveWorkbook.Sheets.Count Else CNTSH = Application.ActiveWorkbook.Worksheets.Count End If End Function Upon adding a new sheet the result doesn't change unless I press: F9; or F2 & Enter; Reenter the complete format. Why? Application.Volatile has been set to true? -- Best Regards, FARAZ A. QURESHI |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Application.Volatile Not Working Timely | Excel Discussion (Misc queries) | |||
Search for 2 true arguments and return true or false | Excel Discussion (Misc queries) | |||
Call Center Management: How to calculate 'cost per call' | Excel Discussion (Misc queries) | |||
Function to return True/False if all are validated as True by ISNU | Excel Worksheet Functions | |||
Application.Volatile not working as expected | Excel Discussion (Misc queries) |