This is going to be a challenge. This is a small test in comparision to the data (within rows and columns on Sheet2) I want to extract from Sheet2.
Sheet2 has the following ranges: A3:B54 (however, the code below shows ranges A20:C21). In Column A, is the name of a specific Patch Status (51 in all). In Column B, there will be a number from 0 to Max.
If you look in the With oExcel code below, accessCount, loginCount and wolCount will have a value of 0 or better. Now, in the Sub AddChart, there is the .Range selection method that will capture all of the Patch Statuses and their values. My question is how can I extract or select only specific ranges that have a value > 0. It appears as if the Range method in the AddChart subroutine is not the solution I'm looking for. Does anyone have a small sample of code or how I could actually build and store the specific ranges I need so that the Chart will only graph those values greater than 0? I'm hoping there is an easy solution that I can put within the AddChart sub.
Thanks for your help and input Experts,
.Cells(21, 1).Value = accessCount
.Cells(21, 2).Value = loginCount
.Cells(21, 3).Value = wolCount
On Error Resume Next
.ActiveChart.ChartType = xl3DPie
.ActiveChart.SeriesCollection(1).DataLabels.ShowValue = True
.ActiveChart.SeriesCollection(1).DataLabels.ShowPercentage = False
.ActiveSheet.Shapes("Chart 1").Left = Sheet1.Cells(4, 1).Left
.ActiveSheet.Shapes("Chart 1").Top = Sheet1.Cells(4, 1).Top
.ActiveSheet.Shapes("Chart 1").Height = Sheet1.Range("A4:D17").Height
.ActiveSheet.Shapes("Chart 1").Width = Sheet1.Range("A4:D17").Width