AHRK
真好人卡
在东方养老院看着你们
关注数: 41
粉丝数: 1,215
发帖数: 11,119
关注贴吧数: 55
吃 雪 糕
贪 玩 空 手 部
お尋ね者と化した先輩 黑 色 高 级 车 主炮发射
雪 人 兄 弟
也许是因为失去主流的地位而自暴自弃,陀螺追尾了黑色高级车
关于VBA的问题 代码如下 Sub 批量获取文件名() Cells = "" Dim sfso Dim myPath As String Dim Sh As Object Dim Folder As Object Application.ScreenUpdating = False On Error Resume Next Set sfso = CreateObject("Scripting.FileSystemObject") Set Sh = CreateObject("shell.application") Set Folder = Sh.BrowseForFolder(0, "", 0, "") If Not Folder Is Nothing Then myPath = Folder.Items.Item.Path End If Application.ScreenUpdating = True Cells(1, 1) = "旧版名称" Cells(1, 2) = "文件类型" Cells(1, 3) = "所在位置" Cells(1, 4) = "新版名称" Call 直接提取文件名(myPath & "\") End Sub Sub 直接提取文件名(myPath As String) Dim i As Long Dim myTxt As String i = Range("A1048576").End(xlUp).Row myTxt = Dir(myPath, 31) Do While myTxt <> "" On Error Resume Next If myTxt <> ThisWorkbook.Name And myTxt <> "." And myTxt <> ".." And myTxt <> "081226" Then i = i + 1 Cells(i, 1) = "'" & myTxt If (GetAttr(myPath & myTxt) And vbDirectory) = vbDirectory Then Cells(i, 2) = "文件夹" Else Cells(i, 2) = "文件" End If Cells(i, 3) = Left(myPath, Len(myPath) - 1) End If myTxt = Dir Loop End Sub 用原本的代码,打开的是这样的怎么打开是想这样?
首页
1
2
3
下一页