VBA Count cells in column containing specified value

后端 未结 5 1339
既然无缘
既然无缘 2020-12-08 07:11

I need to write a macro that searches a specified column and counts all the cells that contain a specified string, such as \"19/12/11\" or \"Green\"

5条回答
  •  囚心锁ツ
    2020-12-08 07:30

    If you're looking to match non-blank values or empty cells and having difficulty with wildcard character, I found the solution below from here.

    Dim n as Integer
    n = Worksheets("Sheet1").Range("A:A").Cells.SpecialCells(xlCellTypeConstants).Count
    

提交回复
热议问题