I was asked to perform a macro in VBA and I am having a problem that I have to perform an operation with dates, I retrieve the date in the format "hh,mm" [15:59] and when trying to do a subtraction between two dates It gives me an error 13, that the types do not match. Any suggestion that you recommend me, the truth is that I have never done macros. Beforehand thank you very much.
h2 = Format(Range(strColumnaC).Value, "hh:mm")
h1 = Format(Range(strColumnaC).Value, "hh:mm")
h3 = h2-h1
I have solved the problem with the help of the comments.
And finally I calculate the result in this way, "n" indicates that the result I want is in minutes format.