Hello All,
I Keep getting a type mismatch error when trying to execute the following code. I want to search for a column heading 'goods in' then return the reoccurrence of the partial text string 'Supplies' but I keep getting a 'Type Mismatch Error' on the code line that contains the count if function. Is anyone able to help?
Thanks in advance,
Antm79
I Keep getting a type mismatch error when trying to execute the following code. I want to search for a column heading 'goods in' then return the reoccurrence of the partial text string 'Supplies' but I keep getting a 'Type Mismatch Error' on the code line that contains the count if function. Is anyone able to help?
Code:
Sub Count()
Dim Strrng As Range
Dim StrCol As Long
Dim StrResult As Long
Set Strrng = Rows(2).Find("Goods In")
StrCol = Strrng.Column
StrResult = Application.CountIf(StrCol, "*" & "Supplies" & "*")
End Sub
Thanks in advance,
Antm79