|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub test()
- Dim r%, i%
- Dim arr, brr
- Dim mypath$, myname$
- mypath = ThisWorkbook.Path & ""
- With Worksheets("sheet1")
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- arr = .Range("a2:b" & r)
- For i = 1 To UBound(arr)
- Open mypath & arr(i, 1) & ".txt" For Output As #1
- Print #1, "S:""Hostname""=" & arr(i, 2)
- Print #1, "S:""Firewall Name""=" & arr(i, 1)
- Print #1, "S:""Username""="
- Print #1, "S:""Log Filename""=" & mypath & arr(i, 1) & ".txt"
- Close #1
- Next
- End With
- End Sub
复制代码 |
|