Hello,
I have an array that can have a different number of columns and rows. Sometimes there can be *'s as the values. I am trying to eliminate them, but first I need to be able to count the number of *'s in each column. I have to step through each column at a time because of other steps I do immediately after. I am trying the code below, but it is giving me an "Object Required" error at the AstCount line.
The BS_Array array does exist, it works fine in every other part of the code. I have also dimmed AstCount as an Integer.
I also tried using just "*" as the argument in the countif statement, but that didn't work either, and I read somewhere online that a ~ needs to be placed before the asterisk actually look for an asterisk.
Any help would be appreciated.
I have an array that can have a different number of columns and rows. Sometimes there can be *'s as the values. I am trying to eliminate them, but first I need to be able to count the number of *'s in each column. I have to step through each column at a time because of other steps I do immediately after. I am trying the code below, but it is giving me an "Object Required" error at the AstCount line.
Code:
For J = LBound(BS_Array, 2) To UBound(BS_Array, 2)
AstCount = WorksheetFunction.CountIf(Application.Index(BS_Array, , J), "~*")
Next J
The BS_Array array does exist, it works fine in every other part of the code. I have also dimmed AstCount as an Integer.
I also tried using just "*" as the argument in the countif statement, but that didn't work either, and I read somewhere online that a ~ needs to be placed before the asterisk actually look for an asterisk.
Any help would be appreciated.
Last edited: