Firstly, I have filtered out some of my data using the Autofilter function. As a result, the filtered data consists of a non-contiguous range of cells. Consequently, for example, when I want to use the CountIfs function in order to count the number of 03-In Analysis from Column C that belong to 07-customer noticed from column A, the CountIfs function still counts the unfiltered data as the output.
Filtered Data

When I use SpecialCells(xlCellTypeVisible), I end up getting an error due to the non-contiguous range of cells.
Since, I am a beginner in VBA and coding in general, I am unable to figure out an appropriate solution for this problem. Therefore any help would be really appreciated!
Here's the code I've written so far:
Dim sh, ws As Worksheet
Dim count
Dim range1, range2 As Range
Set range1 = ws.Range("A2:A297")
Set range2 = ws.Range("C2:C297")
count = WorksheetFunction.CountIfs(range1, "07-customer noticed", range2, "03-In Analysis")
sh.Range("A1") = count