如何在excel批量添加文件夹文件到表格的超链接?
发布网友
发布时间:2022-04-23 03:26
我来回答
共1个回答
热心网友
时间:2023-05-06 15:50
Sub main()
Dim i As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "Excel File", "*.xls*"
If .Show = -1 Then
For i = 1 To .SelectedItems.Count
Cells(i, 1) = "=HYPERLINK(""" & .SelectedItems(i) & """)"
Next i
End If
End With
End Sub
以上代码可以实现