Macro gives me expected en sub error

[Closed]
Report
Posts
34
Registration date
Monday March 10, 2014
Status
Member
Last seen
September 21, 2015
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
Hello,

I have the below macro, but it gives me compile error expected end sub. This macro below I have copied and paste hoping it would work because I am trying to use countif with column A (a d/m/y format) and the below is to be able to use sumif and countif with date format. Thanks

Sub CountifVBAcontainingdateformat()

Function TypeCell(A As Range) As Variant
Dim V() As Variant
Dim Cel As Range
Dim I As Integer
Application.Volatile '// For revaluation in interactive environment
ReDim V(R.Cells.Count - 1) As Variant
I = 0
For Each Cel In R
V(I) = VarType(Cel) '// Output array has the same size of input range.
I = I + 1
Next Cel
TypeCell = V

End Sub

1 reply

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
801
I am confused. there is function within a macro and there is no end function.
please post a very small extract of your data and explain what you are aiming at.