![]() Add Type:=xlCaptionContains, Value1:=ParamValue PivotTables("P1").PivotFields(ParamValue).PivotFilters _ PivotTables("P1").PivotFields(ParamValue).ClearAllFilters Cells(LastRow1 + 22, 3) = rLastCell.Value 'Performance enhancement, as there is no need for copy/past. 'Get the row count from your pivot table. Set PvtTbl = Worksheets("PivotTable").PivotTables("P1") '? LastRow1 = ws1.Cells(Rows.Count, 1).End(xlUp).Row Sub PivotTable(ByVal ParamValue As String) So when the filter is done on vulnerability name for Microsoft Office, I need a row count done on the filtered data too. This row count needs to be done in each With block of code. So far I have this code to do the count: lRowCount = ActiveSheet.PivotTables("P1").īut not sure where to integrate this and how copy the lRowCount value. Range("$B$3").Value = "Microsoft Office" Ws2.Cells(LastRow1 + 3, 3).PasteSpecial xlPasteValues 'Microsoft Windows in cell B3 and the grand total count of this filterĪdd Type:=xlCaptionContains, Value1:="Microsoft Office" 'the words Microsoft Office in their description, then it inserts the words 'Microsoft Office- This filters the table by any vulnerabilities that have Range("$B$2").Value = "Microsoft Windows" Cells(LastRow1 + 2, 3).PasteSpecial xlPasteValues _Īdd Type:=xlCaptionContains, Value1:="Microsoft Windows" Ws1.PivotTables("P1").PivotFields(" Vulnerability Name").PivotFilters. Ws1.PivotTables("P1").PivotFields(" Vulnerability Name").ClearAllFilters 'Microsoft Windows in cell B2 and the grand total count of this filter 'the words Microsoft Windows in their description, then it inserts the words 'Microsoft Windows - This filters the table by any vulnerabilities that have Ws2.Cells(LastRow1 + 22, 3).PasteSpecial xlPasteValues Set PvtTbl = Worksheets("PivotTable").PivotTables("P1") ![]() Ws1.PivotTables("P1").ManualUpdate = False Ws1.PivotTables("P1").ManualUpdate = True 'found in the grand total line of the of the pivot table, in the summary sheet 'Total - This inserts the word Total in cell B22 and pastes the total value LastRow1 = ws1.Cells(unt, 1).End(xlUp).Row Set ws2 = ActiveWorkbook.Sheets("Summary") Set ws1 = ActiveWorkbook.Sheets("PivotTable") I need to integrate the count into the code I already have, which is below: Option Explicit So I pretty much need to do a count from row 4 - row 133 (which in this case is a total row count of 130) of the pivot table and paste that value in cell B23 on the summary sheet. I need to do a row count of the rows in the pivot table between the "header" row of the table and the "grand total" row of the table and then copy the value that the count finds, to a summary sheet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |