Else If doesn't work how it should

Yours works because you aren’t doing what I’m doing. I’m referencing a row index in a datatable, in the second condition. That’s why the error is that row index -1 doesn’t exist. It’s processing the ElseIf even though the first condition is met. Yours is doing the same thing, but your second ElseIf condition can’t error out so you’re not getting an error. Change your second condition to…

dtTest.Rows(intDtIndex -1)(0).ToString = “Something”