|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Option Explicit
Sub test()
Dim strFileName$, strPath$, Rng As Range
strPath = ThisWorkbook.Path & "\"
strFileName = strPath & "文本\A-1.txt"
If Dir(strFileName) = "" Then MsgBox "导入文件不存在,请检查!", vbExclamation: Exit Sub
Application.ScreenUpdating = False
With Workbooks.Open(strFileName)
With .Sheets(1)
Set Rng = Range(.[A1], .Cells(Rows.Count, "A").End(3))
With ThisWorkbook.Sheets(1)
.Columns(1).Clear
Rng.Copy .[A3]
End With
End With
.Close False
End With
Set Rng = Nothing
Application.ScreenUpdating = True
End Sub |
评分
-
1
查看全部评分
-
|