|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 ning84 于 2024-10-22 11:02 编辑
- Function JpgFilesToRng(Rng As Range, oFiles As Files)
- Dim oFile As File
- Set oFile = oFiles(2)
- Stop
- With oFiles
- For ii = 1 To .Count
- 'Stop
-
-
- Next ii
- End With
- kk = 1
- For Each oFile In oFiles
- Rng(kk, 1) = oFile.Path
- kk = kk + 1
-
- Next oFile
- End Function
- Sub JpgFileToRngAA()
- Dim Str, ii, jj
- Dim Fso As Scripting.FileSystemObject
- Set Fso = New Scripting.FileSystemObject
- Dim oFolder As Folder
- Dim Fia As FileDialog
- Set Fia = Application.FileDialog(msoFileDialogFolderPicker)
- With Fia
- .AllowMultiSelect = True
- .Show
- Str = .SelectedItems(1)
- End With
- Stop
- Dim Files As Files
- Set oFolder = Fso.GetFolder(Str)
-
- Dim Rng As Range
- Set Rng = Selection
- Dim Sht As Worksheet
- Set Sht = Rng.Parent
- Set Rng = Sht.Cells(Rng.Row, "AA")
- JpgFilesToRng Rng, oFolder.Files
-
-
-
- End Sub
复制代码
|
|