|
楼主 |
发表于 2024-9-8 20:05
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Private Sub SelectFileChangeShtName()
- Dim Str
- Dim oFile As Scripting.File
- Dim FileDia As FileDialog
-
- Set FileDia = Application.FileDialog(msoFileDialogFilePicker)
-
- With FileDia
- .AllowMultiSelect = True
- .Show
- Str = .SelectedItems(1)
- End With
-
-
-
- Str = Mid(Str, InStrRev(Str, "") + 1, 40)
-
- Str = Replace(Str, ".pptm", "")
- Dim Rng As Range
- Set Rng = Selection
- Dim Sht As Worksheet
- Set Sht = Rng.Parent
- Sht.Name = Str
- Stop
- Stop
- Stop
- End Sub
复制代码 |
|