I have a basic set of data with filters applied, I am simply trying to Figure out how to store a Numeric variable that is the count of filled cells.
Example: I have 100 rows before applying filters, I filter by date and now data is only 10 rows, I tried using End(xlUp) and End (xlDown).row, but this is returning the value of the bottom row in the data, and because it's filtered, its not the same amount of rows filled. (i.e. returning 13 as a variable because thats the last row data is on, but theres only 10 open rows.)
I've also attempted this but It's saying object required so I can't figure out how this function would return a number.
Example: I have 100 rows before applying filters, I filter by date and now data is only 10 rows, I tried using End(xlUp) and End (xlDown).row, but this is returning the value of the bottom row in the data, and because it's filtered, its not the same amount of rows filled. (i.e. returning 13 as a variable because thats the last row data is on, but theres only 10 open rows.)
I've also attempted this but It's saying object required so I can't figure out how this function would return a number.
VBA Code:
Sub Count_cells_fromRange()
Dim ws As Worksheet
Dim RowNum As Long
Set ws = Worksheets("Test Ship Report")
Set RowNum = Application.WorksheetFunction.CountA(ws.Range("B:B"))
MsgBox ("Count Of Cells Is " & RowNum)
End Sub