I added the following code to an existing VBA subroutine (which worked fine) and I get a type mismatch error:
If (GOR1 = GOR2) Then
For i = 0 To Denom
Range("VOL8_GOR")(i, 1) = Range("Vol8_P2")(i, 1) * GOR1 <- on this line
Next i
Exit Sub
End If
GOR1, GOR2 are doubles. i is an integer. Denom is an integer.
I use this line later on with no trouble:
Range("VOL8_GOR")(i, 1) = Range("VOL8_GOR")(i, 1) * Range("Vol8_P2")(i, 1)
Any ideas why I would get this error?
thanks
Fred Emmerich
If (GOR1 = GOR2) Then
For i = 0 To Denom
Range("VOL8_GOR")(i, 1) = Range("Vol8_P2")(i, 1) * GOR1 <- on this line
Next i
Exit Sub
End If
GOR1, GOR2 are doubles. i is an integer. Denom is an integer.
I use this line later on with no trouble:
Range("VOL8_GOR")(i, 1) = Range("VOL8_GOR")(i, 1) * Range("Vol8_P2")(i, 1)
Any ideas why I would get this error?
thanks
Fred Emmerich