{"id":113,"date":"2019-04-09T21:10:00","date_gmt":"2019-04-09T21:10:00","guid":{"rendered":"https:\/\/keithratner.live\/optionexplicit\/?p=113"},"modified":"2019-04-26T21:04:20","modified_gmt":"2019-04-26T21:04:20","slug":"slicercount","status":"publish","type":"post","link":"https:\/\/keithratner.live\/optionexplicit\/slicercount\/","title":{"rendered":"SlicerCount"},"content":{"rendered":"<pre>Public Function SlicerCount( _\r\n    scl As SlicerCacheLevel, _\r\n    Optional NonBlankOnly As Boolean = True, _\r\n    Optional Verbose As Boolean = True _\r\n)\r\n    Dim si As SlicerItem\r\n    Dim iCount As Integer\r\n    Dim iVerboseCount As Integer\r\n    Dim iTotal As Integer\r\n    iCount = 0\r\n    If Verbose Then\r\n        iVerboseCount = 0\r\n        iTotal = scl.SlicerItems.Count\r\n    End If\r\n    For Each si In scl.SlicerItems\r\n        If NonBlankOnly Then\r\n            If SlicerItemIsPopulated(si) Then\r\n                iCount = iCount + 1\r\n            End If\r\n        Else\r\n            iCount = iCount + 1\r\n        End If\r\n        If Verbose Then\r\n            iVerboseCount = iVerboseCount + 1\r\n            Application.StatusBar = _\r\n                \"Counting Slicer Items (\" & _\r\n                Pct( _\r\n                    iVerboseCount, _\r\n                    iTotal _\r\n                ) & _\r\n                \" complete)...\"\r\n        End If\r\n    Next si\r\n    SlicerCount = iCount\r\n    If Verbose Then\r\n        Application.StatusBar = False\r\n    End If\r\nEnd Function<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Public Function SlicerCount( _ scl As SlicerCacheLevel, _ Optional NonBlankOnly As Boolean = True, _ Optional Verbose As Boolean = True _ ) Dim si As SlicerItem Dim iCount As Integer Dim iVerboseCount As Integer Dim iTotal As Integer iCount = 0 If Verbose Then iVerboseCount = 0 iTotal = scl.SlicerItems.Count End If For Each [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":114,"comment_status":"open","ping_status":"open","sticky":false,"template":"page-templates\/full-width-no-post-thumbnail.php","format":"standard","meta":{"inline_featured_image":false,"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5,4,6,3],"tags":[],"class_list":["post-113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code","category-distribution","category-snippets","category-vba"],"krwpengineoptions-featuredonwpengineblog":"","jetpack_featured_media_url":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/slicercount.png?fit=332%2C568&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgsIIA-1P","jetpack-related-posts":[{"id":116,"url":"https:\/\/keithratner.live\/optionexplicit\/matchespattern\/","url_meta":{"origin":113,"position":0},"title":"MatchesPattern","author":"Keith","date":"April 10, 2019","format":false,"excerpt":"Public Function MatchesPattern( _ strInputTest As String, _ strInputPattern As String, _ Optional IgnoreCase As Boolean = True, _ Optional IsGlobal As Boolean = True _ ) As Boolean On Error GoTo Catch Dim objRegExp As New RegExp Set objRegExp = Nothing objRegExp.IgnoreCase = IgnoreCase objRegExp.Global = IsGlobal objRegExp.Pattern =\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/matchespattern.png?fit=318%2C299&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":60,"url":"https:\/\/keithratner.live\/optionexplicit\/hashiddencolumns\/","url_meta":{"origin":113,"position":1},"title":"HasHiddenColumns","author":"Keith","date":"April 4, 2019","format":false,"excerpt":"Public Function HasHiddenColumns( _ rng As Range _ ) As Boolean Dim _ rngColumn As Range HasHiddenColumns = False For Each rngColumn In rng.Columns If rngColumn.Hidden Then HasHiddenColumns = True End If Next rngColumn End Function Usage: Dim _ wsSource As Worksheet, _ rngSource as Range Set wsSource = ThisWorkbook.Sheets(\"Sheet1\")\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":177,"url":"https:\/\/keithratner.live\/optionexplicit\/workbooksheetexists\/","url_meta":{"origin":113,"position":2},"title":"WorkbookSheetExists","author":"Keith","date":"July 10, 2019","format":false,"excerpt":"Public Function WorkbookSheetExists( _ wb As Workbook, _ strSheetName As String _ ) As Boolean Dim ws As Worksheet WorkbookSheetExists = False For Each ws In wb.Sheets If ws.Name = strSheetName Then WorkbookSheetExists = True End If Next ws End Function","rel":"","context":"In &quot;VBA&quot;","block_context":{"text":"VBA","link":"https:\/\/keithratner.live\/optionexplicit\/category\/vba\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":125,"url":"https:\/\/keithratner.live\/optionexplicit\/vbcomponentnameisunique\/","url_meta":{"origin":113,"position":3},"title":"VBComponentNameIsUnique","author":"Keith","date":"April 10, 2019","format":false,"excerpt":"Public Function VBComponentNameIsUnique( _ wb As Workbook, _ strInputName As String _ ) As Boolean Dim vbc As VBComponent VBComponentNameIsUnique = True For Each vbc In wb.VBProject.VBComponents If vbc.Name = strInputName Then VBComponentNameIsUnique = False End If Next vbc End Function","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/vbomponentnameisunique.png?fit=324%2C200&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":83,"url":"https:\/\/keithratner.live\/optionexplicit\/haskey\/","url_meta":{"origin":113,"position":4},"title":"HasKey","author":"Keith","date":"April 8, 2019","format":false,"excerpt":"Function HasKey( _ coll As Collection, _ index As Variant _ ) As Boolean On Error GoTo ErrorHandler Dim elTest As Variant HasKey = False elTest = coll(index) HasKey = True Exit Function ErrorHandler: End Function","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":175,"url":"https:\/\/keithratner.live\/optionexplicit\/folderexists\/","url_meta":{"origin":113,"position":5},"title":"FolderExists","author":"Keith","date":"July 8, 2019","format":false,"excerpt":"Function FolderExists( _ strCompleteFolderPath As String _ ) As Boolean Dim _ fs As Object Set _ fs = _ CreateObject( _ \"Scripting.FileSystemObject\" _ ) FolderExists = _ fs.FolderExists( _ strCompleteFolderPath _ ) Set _ fs = _ Nothing End Function","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/comments?post=113"}],"version-history":[{"count":1,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/113\/revisions"}],"predecessor-version":[{"id":115,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/113\/revisions\/115"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/media\/114"}],"wp:attachment":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/media?parent=113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/categories?post=113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/tags?post=113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}