我对 VBA 的经验很少,但有其他编程经验。我有一个循环可以将正确的数据写入正确的位置。但是,循环之后的代码没有完成。我相信我没有正确终止循环,但还没有弄清楚如何让它结束。
Dim i As Integer
Dim j As Integer
Dim TestInfo, PatID, TestCode, OAValue As String
For i = 2 To 25
Columns(i).Select
If Cells(1, i).Value = 0 Then
End
Else
For j = 2 To 52
Rows(j).Select
PatID = Cells(1, i).Value
TestCode = Cells(j, 1).Value
OAValue = Cells(j, i).Value
TestInfo = PatID & "," & TestCode & "," & OAValue
stream.WriteLine TestInfo
Next j
End
End If
Next i
End
stream.Close
ActiveWorkbook.Close savechanges:=False
任何帮助将不胜感激。先感谢您。