Hey Skip,
this works:
Sub testtest()
Dim r As Range, sPID As String, c As Range, sSql As String
Open "Datafile.txt" For Output As #1
For Each r In Range(Cells(2, "B"), Cells(2, "B").End(xlDown))
With r
For Each c In Range(Cells(.Row, "C"), Cells(.Row, "M"))
With c
If...