Hello, I am trying to grab a number from a string to determine if it is even or odd. I am using the following function
Dim i As Integer
For i = 2 To 944
If Mid("H" & i, 8, 8) = "8" And Mid("H" & i, 8, 9) Mod 2 <> 0 Then
Range("A" & i & ":J" & i).Copy Destination:=Sheets(test)
End If
However when I run it I get the error message type mismatch. I am assuming this is due to the fact I am running a math function on a string? Any suggestions or change I can use to get this to work right? I saw one example that used the .NumberFormat but that threw errors as well. What is the best way to parse a string character into type int?
Bookmarks