|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Option Explicit
Sub TEST1()
Dim ar, br, i&, r&, strJoin$
ar = Range("H3", Cells(Rows.Count, "H").End(xlUp))
br = [Q3].CurrentRegion
For i = 1 To UBound(ar)
If ar(i, 1) = 4 Then
r = r + 1
ar(r, 1) = br(i, 1) & "-" & br(i, 2) & "-" & br(i, 3) & "=" & br(i, 4) & "," & br(i, 5) & "," & br(i, 6) & "/" & br(i, 7)
strJoin = strJoin & vbCrLf & ar(r, 1)
End If
Next i
If strJoin <> "" Then
Open ThisWorkbook.Path & "\ " & [H2].Value & ".txt" For Output As #1
For i = 1 To 5
Print #1, Mid(strJoin, 3)
Next i
Close #1
End If
Beep
End Sub |
评分
-
1
查看全部评分
-
|