Hi there, I'm trying to identify and fix double spaces in a string (that comes from a csv file.) My code originally came from kleinma in this thread, but after tweeking it, it's not working. On the net, everyone else seems to be using the same indexof/replace code. So can someone tell me why my code isn't working? That would great. Thank you.

Code:
	While Not therea.EndOfData
                therow = therea.ReadFields()
                x = 0
                For Each datval In therow
                    wordat(x) = datval

                    If datval.IndexOf("  ") <> -1 Then
                        datval = datval.Replace("  ", " ")
                        MsgBox("double space found")
                    End If

                Next
            End While