国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

VBA批量給工作簿重命名

2023-06-11 01:11 作者:哈哈0000zero  | 我要投稿

Sub GetFiles()

? ? Dim strPath As String, strFileName As String, k As Long

? ? With Application.FileDialog(msoFileDialogFolderPicker)

? ? ? ? If .Show Then strPath = .SelectedItems(1) Else: Exit Sub

? ? ? ? '獲取用戶(hù)選擇的文件夾的路徑,如果未選取,則退出程序

? ? End With

? ? If Right(strPath, 1) <> "\" Then strPath = strPath & "\"

? ? Application.ScreenUpdating = False

? ? Range("a:b").Clear: k = 1

? ? '清除A:B列的所有

? ? Cells(1, 1) = "舊文件名": Cells(1, 2) = "新文件名"

? ? strFileName = Dir(strPath & "*.xls*")

? ? Do While strFileName <> ""

? ? ? ? k = k + 1

? ? ? ? Cells(k, 1) = strPath & strFileName

? ? ? ? strFileName = Dir

? ? Loop

? ? Application.DisplayAlerts = True

End Sub




Sub ChangeFileName()

? ? Dim r, i As Long

? ? r = Range("a1").CurrentRegion '數(shù)據(jù)裝入數(shù)組

? ? For i = 2 To UBound(r)

? ? '標(biāo)題行不要,從數(shù)組第二行開(kāi)始遍歷

? ? ? ? Name r(i, 1) As r(i, 2) 'Name語(yǔ)句重命名

? ? Next

? ? MsgBox "更名完成。"

End Sub


VBA批量給工作簿重命名的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
吴堡县| 文成县| 田阳县| 五指山市| 汉沽区| 牟定县| 新龙县| 香格里拉县| 白银市| 古田县| 德清县| 惠安县| 仪陇县| 当涂县| 罗平县| 牡丹江市| 鲜城| 黔南| 苏尼特左旗| 长乐市| 封丘县| 图们市| 赣榆县| 区。| 安阳市| 汉源县| 海原县| 红河县| 苍梧县| 错那县| 榕江县| 灵寿县| 肇源县| 肇州县| 年辖:市辖区| 青浦区| 阳泉市| 凤冈县| 原阳县| 扬中市| 新建县|