|
- Sub test0() '这个意思?若不对,你得模拟效果,截个图就行
- Dim ar, i As Long, j As Long
- ar = Range("A1").CurrentRegion
- For i = 1 To UBound(ar)
- For j = 2 To UBound(ar, 2)
- ar(i, 1) = ar(i, 1) & vbTab & ar(i, j)
- Next
- Next
- ar = WorksheetFunction.Transpose(WorksheetFunction.Index(ar, 0, 1))
- With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
- .SetText Join(ar, vbCrLf)
- .PutInClipboard
- End With
- '以上 将内容全部写入 粘贴板
-
- '以下 为导出文本文件 自行取舍
- Open ThisWorkbook.Path & "" & "导出.txt" For Output As #1
- Print #1, Join(ar, vbCrLf)
- Close #1
- End Sub
复制代码 |
|