|
Sub test1() '这个意思?
Dim i As Long, j As Long, k As Long
Dim s As String, t As String
j = Range("A1").CurrentRegion.Rows.Count
For i = 1 To j - 1
k = k + 1
s = "IF(k=" & i & ",p(J" & i & "," & i - 1 & "),"
t = t & Chr(10) & s
If k = 5 Then
t = t & "0" & String(k, ")") & ";" & Chr(10)
k = 0
End If
Next
If k Then t = t & "0" & String(k, ")") & ";" & Chr(10) & Chr(10)
With CreateObject("Scripting.FileSystemObject").OpenTextFile(ThisWorkbook.Path & "\test.txt", 8, -1)
.Write Mid(t, 2)
.Close
End With
'Open ThisWorkbook.Path & "\test.txt" For Output As #1
'Print #1, Mid(t, 2)
'Close #1
Beep
End Sub |
评分
-
3
查看全部评分
-
|