|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub wrtInTxt()
- Dim oClp As Object
- Dim Flnm$, Str$
- Dim Wb As Workbook
- Set oClp = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
- Flnm = Application.GetOpenFilename("Excel文件,*.xls", , "请选择")
- Set Wb = GetObject(Flnm)
- Wb.Sheets(1).[A6].CurrentRegion.Copy
- oClp.getfromclipboard: Str = oClp.gettext
- [A1].Copy: Set oClp = Nothing
- Wb.Close 0
-
- Open Replace(Flnm, ".xls", ".txt") For Output As #1
- Print #1, Str: Reset
- MsgBox "数据已写入文本中。"
- End Sub
复制代码 |
|